Support evaluation-local configuration and names overrides

This commit is contained in:
sebastien committed 2026-11-03 18:44:56 +01:00
1 parent 0bb6f7d97c
commit d4404e4c27
36 files changed
+409 -184

No files matched your search

+3 -3
View File
@@ -24,7 +24,7 @@ class AnnotationImportCleanupTests(unittest.TestCase):
(self.workspace.root / "correction.json").write_text("{}")
self.import_dir = self.root / "Annotées"
self.import_dir.mkdir()
self.patch = patch.object(import_annotations, "IMPORT_DIR", self.import_dir)
self.patch = patch.object(import_annotations.configuration, "IMPORT_DIR", self.import_dir)
self.patch.start()
self.addCleanup(self.patch.stop)
@@ -45,12 +45,12 @@ class AnnotationImportCleanupTests(unittest.TestCase):
def test_cleanup_handles_unconfigured_or_missing_folder(self):
for configured in (None, "", self.root / "absent"):
with self.subTest(configured=configured), \
patch.object(import_annotations, "IMPORT_DIR", configured):
patch.object(import_annotations.configuration, "IMPORT_DIR", configured):
import_annotations.clear_import_directory(self.workspace)
self.assertFalse((self.root / "absent").exists())
def test_cleanup_rejects_an_ancestor_of_evaluation(self):
with patch.object(import_annotations, "IMPORT_DIR", self.root), \
with patch.object(import_annotations.configuration, "IMPORT_DIR", self.root), \
self.assertRaises(CliError):
import_annotations.clear_import_directory(self.workspace)
self.assertTrue(self.workspace.root.is_dir())