Keep empty answers in the final individual outputs.
This commit is contained in:
1 parent
b1f1e0bc86
commit
e7094d850e
8 files changed
+164
-37
No files matched your search
@@ -115,6 +115,29 @@ class ModificationTests(unittest.TestCase):
|
||||
self.assertFalse((self.output / "Empty.jpg").exists())
|
||||
self.assertFalse(read_json(self.output / "info.json")["Empty"]["not_empty"])
|
||||
|
||||
def test_retained_empty_scan_stays_empty_after_unrelated_edits_and_can_be_replaced(self):
|
||||
self.images["Empty"] = Image.new("RGB", (100, 60), "white")
|
||||
self.heights["Empty"] = 10
|
||||
self.info["Empty"]["present"] = True
|
||||
self.seed()
|
||||
self.apply("Copie43 Ex 1 -> Ex 2|")
|
||||
info = read_json(self.output / "info.json")
|
||||
self.assertTrue((self.output / "Empty.jpg").is_file())
|
||||
self.assertEqual(info["Empty"], self.info["Empty"])
|
||||
with Image.open(self.output / "Concat.jpg") as image:
|
||||
self.assertEqual(image.height, 120 + 180 + 40)
|
||||
self.apply("Copie43 Ex 1 -> Empty")
|
||||
self.assertTrue(read_json(self.output / "info.json")["Empty"]["not_empty"])
|
||||
self.apply()
|
||||
self.assertEqual(read_json(self.output / "info.json")["Empty"], self.info["Empty"])
|
||||
|
||||
def test_removed_body_is_absent_and_not_exported_as_an_empty_scan(self):
|
||||
self.apply("Copie43 Ex 1 x> Ex 2")
|
||||
info = read_json(self.output / "info.json")["Ex 1"]
|
||||
self.assertFalse(info["present"])
|
||||
self.assertFalse(info["not_empty"])
|
||||
self.assertFalse((self.output / "Ex 1.jpg").exists())
|
||||
|
||||
def test_invalid_file_does_not_apply_valid_first_instruction(self):
|
||||
before = {p.name: p.read_bytes() for p in self.output.iterdir() if p.is_file()}
|
||||
with self.assertRaises(CliError):
|
||||
|
||||
Reference in new issue
Block a user