Adopt Pixaroma save image preview features

This commit is contained in:
2026-10-21 16:08:56 +00:00
parent 494670ded0
commit 36c4537be7
4 changed files with 52 additions and 5 deletions
+13
View File
@@ -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()