Publish first RF4 fish quality upgrades
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s

This commit is contained in:
ik
2026-09-15 11:45:54 +07:00
parent 7d009c932f
commit a8c0da837a
85 changed files with 1733 additions and 556 deletions
+19
View File
@@ -82,3 +82,22 @@ def test_batch_stops_domain_after_three_consecutive_invalid_assets(tmp_path: Pat
assert report["attempted_total"] == 3
assert report["failed_total"] == 3
assert "3 consecutive failures" in report["domains"]["rf4map.ru"]["stopped_reason"]
def test_batch_downloads_quality_upgrade_without_unpublishing_fallback(tmp_path: Path, monkeypatch) -> None:
root = tmp_path / "media"
root.mkdir()
candidate = {"status": "upgrade_queued", "asset_url": "https://rf4db.com/pike.webp", "entity_type": "fish", "duplicate_of": "https://rf4map.ru/pike.png"}
(root / "manifest.json").write_text(json.dumps({"version": 1, "assets": [candidate]}), encoding="utf-8")
def store_upgrade(_root, path, manifest, item):
item["status"] = "upgrade_stored"
media_cli._save_manifest(path, manifest)
return "stored", None
monkeypatch.setattr(media_cli, "_attempt_asset", store_upgrade)
report = _download_batch(root, tmp_path / "state.json", limit=1)
assert report["stored_total"] == 1
assets = json.loads((root / "manifest.json").read_text(encoding="utf-8"))["assets"]
assert assets[0]["status"] == "upgrade_stored"