fix(tests): update test_ensure_camie_skips_when_present to v2 filenames (camie-tagger-v2.onnx + camie-tagger-v2-metadata.json) — pinned-test bounce from 3b3e756
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,11 +9,16 @@ from backend.app.scripts import download_models as dm
|
|||||||
|
|
||||||
|
|
||||||
def test_ensure_camie_skips_when_present(tmp_path, monkeypatch):
|
def test_ensure_camie_skips_when_present(tmp_path, monkeypatch):
|
||||||
|
"""v2 layout (HF Camais03/camie-tagger-v2): the ONNX file is named
|
||||||
|
camie-tagger-v2.onnx (not model.onnx) and tags ship inside
|
||||||
|
camie-tagger-v2-metadata.json (not selected_tags.csv). Both at root.
|
||||||
|
Updated 2026-05-25 after the actual repo layout was confirmed via
|
||||||
|
WebFetch — the old assertion pinned the v1 filenames."""
|
||||||
monkeypatch.setattr(dm, "MODEL_ROOT", tmp_path)
|
monkeypatch.setattr(dm, "MODEL_ROOT", tmp_path)
|
||||||
camie = tmp_path / "camie"
|
camie = tmp_path / "camie"
|
||||||
camie.mkdir(parents=True)
|
camie.mkdir(parents=True)
|
||||||
(camie / "model.onnx").write_bytes(b"x")
|
(camie / "camie-tagger-v2.onnx").write_bytes(b"x")
|
||||||
(camie / "selected_tags.csv").write_text("tag_id,name,category,count\n")
|
(camie / "camie-tagger-v2-metadata.json").write_text("{}")
|
||||||
with patch.object(dm, "_snapshot") as snap:
|
with patch.object(dm, "_snapshot") as snap:
|
||||||
dm.ensure_camie()
|
dm.ensure_camie()
|
||||||
snap.assert_not_called()
|
snap.assert_not_called()
|
||||||
|
|||||||
Reference in New Issue
Block a user