Clear import directory, possibly

This commit is contained in:
sebastien committed 2026-10-06 11:26:03 +02:00
1 parent 52a8589261
commit 22c04f6e15
7 files changed
+88 -6

No files matched your search

+13
View File
@@ -52,6 +52,19 @@ class GuiConvenienceTests(unittest.TestCase):
start.assert_not_called()
self.assertEqual(self.app.state_store.step(step.id)["status"], "success")
def test_annotation_import_cleanup_can_be_unchecked(self):
self.app.tree.selection_set("annotation")
self.app.update()
self.assertTrue(self.app.arg_vars["clear_import"].get())
self.assertIn("--clear-import", self.app._make_command())
self.app.arg_vars["clear_import"].set(False)
self.assertNotIn("--clear-import", self.app._make_command())
self.app.tree.selection_set("export")
self.app.update()
self.app.tree.selection_set("annotation")
self.app.update()
self.assertFalse(self.app.arg_vars["clear_import"].get())
def test_cutleft_visual_check_option_is_below_and_off_by_default(self):
step = self.app.step_by_id["cutleft"]
self.app.current_step = step
+13
View File
@@ -2705,6 +2705,19 @@ class WorkflowTests(unittest.TestCase):
)
self.assertEqual(command[4], "annotate-grouped")
def test_annotation_import_cleanup_defaults_to_configured_folder(self) -> None:
for configured in (None, "", Path("Import")):
with patch.object(workflow_module.configuration, "IMPORT_DIR", configured):
step = next(step for step in build_workflow(False) if step.id == "annotation")
for variant in step.variants:
with self.subTest(configured=configured, variant=variant.id):
command = build_command(REPOSITORY, step, variant, {}, self.evaluation)
self.assertEqual("--clear-import" in command, bool(configured))
command = build_command(
REPOSITORY, step, variant, {"clear_import": False}, self.evaluation
)
self.assertNotIn("--clear-import", command)
def test_copy_preparation_commands_are_python(self) -> None:
rotate = self.command("rotate", "rotate", {"target": self.evaluation})
rename = self.command("rename", "rename", {"target": self.evaluation})