Adopt Pixaroma save image preview features
This commit is contained in:
@@ -155,6 +155,19 @@ class DumasImageNodeTests(unittest.TestCase):
|
||||
nested,
|
||||
)
|
||||
|
||||
def test_preview_mode_writes_temp_images_without_touching_destination(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
FakeImage.saved_paths.clear()
|
||||
self.nodes.DumasSaveImageNode().save_images(
|
||||
[FakeBatch()], directory, "preview_%counter%", "webp", 90, False, False
|
||||
)
|
||||
|
||||
self.assertEqual(len(FakeImage.saved_paths), 1)
|
||||
saved_path = FakeImage.saved_paths[-1][0]
|
||||
self.assertTrue(str(saved_path).startswith(self.temp_dir))
|
||||
self.assertTrue(str(saved_path).endswith(".webp"))
|
||||
self.assertFalse(os.path.exists(os.path.join(directory, "preview_001.webp")))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user