Sort the new modules' imports, and test a reversal count where every chunk holds one

This commit is contained in:
2026-11-12 10:09:19 +01:00
parent 1fc7bf0f52
commit ec0b17b03f
3 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -2,10 +2,10 @@
import json
import pathlib
from transcript_archive.read import chunk_outcomes, finished_chunks
from transcript_archive.outcomes import CONFIG, reversals, workers
from failure import Failure
from score_outcomes.results import plural
from transcript_archive.outcomes import CONFIG, reversals, workers
from transcript_archive.read import chunk_outcomes, finished_chunks
def reversal_lines(project_archive: pathlib.Path) -> list[str] | Failure:
@@ -505,6 +505,11 @@ class Reversals(unittest.TestCase):
chunk_file(archive, "kept", ("2026-11-03T10:00:00Z", outcomes.finished('{"model": "m"}', "e", "j", record=outcomes.Record("c"))))
self.assertEqual(reversal_lines(archive), ["- 2026-11-02T12:00:00Z, item 7: 2 reversed", "- The other 1 finished chunk: none."])
def test_adds_no_line_for_the_others_where_every_chunk_holds_a_reversal(self):
with tempfile.TemporaryDirectory() as root:
chunk_file(pathlib.Path(root), "a", ("2026-11-02T10:00:00Z", outcomes.finished('{"model": "m", "item": 7}', "e", "j", record=outcomes.Record("c", reversed="No."))))
self.assertEqual(reversal_lines(pathlib.Path(root)), ["- 2026-11-02T10:00:00Z, item 7: 1 reversed"])
def test_says_all_chunks_have_none_and_names_no_item_the_worker_line_lacks(self):
with tempfile.TemporaryDirectory() as root:
archive = pathlib.Path(root)