diff --git a/api/tests/unit/test_emulator.py b/api/tests/unit/test_emulator.py index c06e839..26e454a 100644 --- a/api/tests/unit/test_emulator.py +++ b/api/tests/unit/test_emulator.py @@ -111,8 +111,10 @@ class TestRealFixtures: class TestFixtureLookup: def test_exact_beats_prefix(self, tmp_path: Path) -> None: hf = _hotfolder(tmp_path) - fixtures = _fixtures_dir(tmp_path, {"a.json": {"file_uid": "x", "v": "exact"}, "a0.json": {"v": "prefix"}}) - job_id = _drop(hf, "a.pdf") + # `a_b-1.json` по алфавиту раньше `a_b.json` ('-' 0x2D < '.' 0x2E): без шага «точное имя» победил бы префикс + assert sorted(["a_b.json", "a_b-1.json"])[0] == "a_b-1.json" + fixtures = _fixtures_dir(tmp_path, {"a_b-1.json": {"v": "prefix"}, "a_b.json": {"file_uid": "x", "v": "exact"}}) + job_id = _drop(hf, "a_b.pdf") process_once(hf.root, fixtures, 0) assert _answer(hf, job_id) == {"file_uid": job_id, "v": "exact"} @@ -120,7 +122,6 @@ class TestFixtureLookup: hf = _hotfolder(tmp_path) fixtures = _fixtures_dir(tmp_path, {"a_zz.json": {"v": "zz"}, "a_b.json": {"v": "b"}, "a_c.json": {"v": "c"}}) job_id = _drop(hf, "a.pdf") - # `a_*` не совпадает с префиксом `a` по имени без расширения? совпадает: `a*.json` process_once(hf.root, fixtures, 0) assert _answer(hf, job_id)["v"] == "b"