miscs (Interro02) : horizontal cutting resolution
This commit is contained in:
+10
-1
@@ -1340,11 +1340,20 @@ class StandardCliTests(unittest.TestCase):
|
||||
evaluation / "correction.json",
|
||||
{"text": "outside_name and $math_name$", "suffix": "_new"},
|
||||
)
|
||||
original = (evaluation / "correction.json").read_bytes()
|
||||
backup = evaluation / "correction_precleanup.json"
|
||||
backup.write_bytes(b"previous backup")
|
||||
self.assertEqual(module.main([str(evaluation)]), 0)
|
||||
self.assertEqual(backup.read_bytes(), original)
|
||||
self.assertEqual(
|
||||
read_json(evaluation / "correction.json"),
|
||||
{"text": r"outside\_name and $math_name$", "suffix": "_new"},
|
||||
)
|
||||
cleaned = (evaluation / "correction.json").read_bytes()
|
||||
with patch.object(module, "atomic_write_bytes", side_effect=OSError("backup failed")):
|
||||
self.assertNotEqual(module.main([str(evaluation)]), 0)
|
||||
self.assertEqual((evaluation / "correction.json").read_bytes(), cleaned)
|
||||
self.assertEqual(backup.read_bytes(), original)
|
||||
|
||||
def test_manual_resolution_with_no_actions_is_safe(self) -> None:
|
||||
module = self.modules["resolve_manual"]
|
||||
@@ -1891,7 +1900,7 @@ class WorkflowTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
command_arguments(status),
|
||||
["--download", "files/job-1", "--output", "/tmp/result.jsonl"],
|
||||
["--evaluation", self.evaluation],
|
||||
)
|
||||
|
||||
grouped = self.command(
|
||||
|
||||
Reference in New Issue
Block a user