Miscs personal GUI improvement

This commit is contained in:
2026-09-14 09:42:13 +02:00
parent e8b8a11c5b
commit d60d5479d6
5 changed files with 207 additions and 33 deletions
+48
View File
@@ -38,6 +38,7 @@ from copienator_gui.app import (
build_runner_environment,
copy_pdf_paths,
detected_annotation_directories,
get_personal_interro_files,
has_manual_conflicts,
plotting_shortcut_lines,
process_status,
@@ -1660,6 +1661,53 @@ class WorkflowTests(unittest.TestCase):
self.assertNotIn("update_ods", standard_ids)
self.assertIn("update_ods", personal_ids)
def test_get_personal_interro_files_copies_the_three_expected_sources(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
source = root / "source"
evaluation = root / "Interro07"
source.mkdir()
evaluation.mkdir()
contents = {
"Interro07.pdf": b"pdf",
"Interro07.tex": b"statement",
"Interro07c.tex": b"correction",
}
for name, content in contents.items():
(source / name).write_bytes(content)
copied = get_personal_interro_files(evaluation, source)
self.assertEqual(
copied,
(
evaluation / "enonce.pdf",
evaluation / "enonce.tex",
evaluation / "correction.tex",
),
)
self.assertEqual((evaluation / "enonce.pdf").read_bytes(), b"pdf")
self.assertEqual((evaluation / "enonce.tex").read_bytes(), b"statement")
self.assertEqual((evaluation / "correction.tex").read_bytes(), b"correction")
def test_get_personal_interro_files_validates_name_and_all_sources_first(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
source = root / "source"
source.mkdir()
invalid = root / "DS07"
invalid.mkdir()
with self.assertRaisesRegex(ValueError, "Interro"):
get_personal_interro_files(invalid, source)
evaluation = root / "Interro07"
evaluation.mkdir()
(evaluation / "enonce.pdf").write_bytes(b"existing")
(source / "Interro07.pdf").write_bytes(b"new")
with self.assertRaisesRegex(FileNotFoundError, "Interro07.tex"):
get_personal_interro_files(evaluation, source)
self.assertEqual((evaluation / "enonce.pdf").read_bytes(), b"existing")
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