Améliorations GUI
This commit is contained in:
+42
-1
@@ -31,7 +31,7 @@ from copienator import (
|
||||
from copienator.annotation_actions import apply_checkbox_actions, apply_score_overrides
|
||||
from copienator.annotation_data import AnnotationLoadResult, load_annotation_data
|
||||
from copienator.filesystem import staged_directory, staged_files
|
||||
from copienator_gui.app import process_status
|
||||
from copienator_gui.app import has_manual_conflicts, process_status
|
||||
from copienator_gui.diagnostics import collect_diagnostics
|
||||
from copienator_gui.runner import ProcessRunner
|
||||
from copienator_gui.state import StateStore
|
||||
@@ -169,6 +169,17 @@ class AtomicJsonTests(unittest.TestCase):
|
||||
persisted = read_json(root / ".copienator-gui.json")
|
||||
self.assertEqual(persisted["steps"]["labels"]["status"], "success")
|
||||
|
||||
def test_invalidation_preserves_first_visit_marker(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
store = StateStore()
|
||||
store.load(Path(directory))
|
||||
store.update_step("splitting", status="success", visited=True)
|
||||
|
||||
store.invalidate_after(["plotting", "splitting"], "plotting")
|
||||
|
||||
self.assertEqual(store.step("splitting")["status"], "stale")
|
||||
self.assertTrue(store.step("splitting")["visited"])
|
||||
|
||||
|
||||
class AnnotationDataTests(unittest.TestCase):
|
||||
def test_loader_indexes_coordinates_without_mutating_correction(self) -> None:
|
||||
@@ -1366,6 +1377,36 @@ class WorkflowTests(unittest.TestCase):
|
||||
self.assertNotIn("update_ods", standard_ids)
|
||||
self.assertIn("update_ods", personal_ids)
|
||||
|
||||
def test_first_visit_automation_is_declared_on_expected_steps(self) -> None:
|
||||
auto_start = {
|
||||
step.id for step in self.steps.values() if step.auto_start_first_visit
|
||||
}
|
||||
skip_for_live = {
|
||||
step.id for step in self.steps.values() if step.skip_for_live_correction
|
||||
}
|
||||
skip_without_conflicts = {
|
||||
step.id
|
||||
for step in self.steps.values()
|
||||
if step.skip_without_manual_conflicts
|
||||
}
|
||||
|
||||
self.assertEqual(auto_start, {"splitting", "grouping"})
|
||||
self.assertEqual(
|
||||
skip_for_live, {"submit_batches", "batch_status", "fetch_batches"}
|
||||
)
|
||||
self.assertEqual(skip_without_conflicts, {"manual_resolution"})
|
||||
|
||||
def test_manual_conflicts_ignore_blank_and_comment_lines(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
path = Path(directory) / "manual_resolutions.txt"
|
||||
self.assertFalse(has_manual_conflicts(path))
|
||||
path.write_text("\n### Instructions\n ### exemple\n", encoding="utf-8")
|
||||
self.assertFalse(has_manual_conflicts(path))
|
||||
path.write_text(
|
||||
"### Instructions\nCopie01 Ex 1 -> Ex 2\n", encoding="utf-8"
|
||||
)
|
||||
self.assertTrue(has_manual_conflicts(path))
|
||||
|
||||
def test_live_correction_arguments(self) -> None:
|
||||
command = self.command(
|
||||
"correction",
|
||||
|
||||
Reference in New Issue
Block a user