Personal tex compilation fixes
This commit is contained in:
1 parent
ec6ac9580b
commit
705db1068f
8 files changed
+217
-21
No files matched your search
+33
-2
@@ -127,8 +127,9 @@ class WorkspaceTests(unittest.TestCase):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory) / "A"
|
||||
root.mkdir()
|
||||
for name in ("enonce.pdf", "A.pdf", "enonce.tex", "A.tex",
|
||||
"correction.tex", "Ac.tex"):
|
||||
for name in ("enonce.pdf", "énonce.pdf", "énoncé.pdf", "A.pdf",
|
||||
"enonce.tex", "énonce.tex", "énoncé.tex", "A.tex",
|
||||
"correction.tex", "corrige.tex", "corrigé.tex", "Ac.tex"):
|
||||
(root / name).touch()
|
||||
|
||||
workspace = EvaluationWorkspace(root)
|
||||
@@ -136,6 +137,30 @@ class WorkspaceTests(unittest.TestCase):
|
||||
self.assertEqual(workspace.statement_source_file, root / "enonce.tex")
|
||||
self.assertEqual(workspace.correction_source_file, root / "correction.tex")
|
||||
|
||||
def test_alternative_statement_inputs_are_detected_and_validated(self) -> None:
|
||||
for statement in ("énonce", "énoncé"):
|
||||
for correction in ("corrige", "corrigé"):
|
||||
with self.subTest(statement=statement, correction=correction), tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory) / "Exam"
|
||||
root.mkdir()
|
||||
for name in (f"{statement}.pdf", f"{statement}.tex", f"{correction}.tex"):
|
||||
(root / name).touch()
|
||||
workspace = EvaluationWorkspace.discover(root)
|
||||
workspace.require_files("enonce.pdf", "enonce.tex", "correction.tex")
|
||||
self.assertEqual(workspace.statement_pdf_file, root / f"{statement}.pdf")
|
||||
self.assertEqual(workspace.statement_source_file, root / f"{statement}.tex")
|
||||
self.assertEqual(workspace.correction_source_file, root / f"{correction}.tex")
|
||||
self.assertTrue(workspace.is_statement_pdf(root / f"{statement}.pdf"))
|
||||
self.assertEqual(workspace.resolve("correction.tex"), root / f"{correction}.tex")
|
||||
|
||||
def test_discovery_recognizes_each_alternative_input_on_its_own(self) -> None:
|
||||
for name in ("énonce.pdf", "énonce.tex", "énoncé.pdf", "énoncé.tex", "corrige.tex", "corrigé.tex"):
|
||||
with self.subTest(name=name), tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory) / "Exam"
|
||||
root.mkdir()
|
||||
(root / name).touch()
|
||||
self.assertEqual(EvaluationWorkspace.discover(root).root, root)
|
||||
|
||||
def test_discover_and_require_report_clear_errors(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
@@ -2259,6 +2284,12 @@ class StandardCliTests(unittest.TestCase):
|
||||
|
||||
|
||||
class WorkflowTests(unittest.TestCase):
|
||||
def test_statement_compile_variant_avoids_gemini_and_restart(self) -> None:
|
||||
command = self.command('statement', 'compile',
|
||||
{'target': self.evaluation, 'restart': True})
|
||||
self.assertIn('--compile-only', command)
|
||||
self.assertNotIn('--restart', command)
|
||||
|
||||
def setUp(self) -> None:
|
||||
self.steps = {step.id: step for step in build_workflow(True)}
|
||||
self.evaluation = evaluation_argument(REPOSITORY, REPOSITORY / "Example")
|
||||
|
||||
Reference in new issue
Block a user