feat: expand RF4 media inventory
This commit is contained in:
@@ -36,6 +36,7 @@ def test_fetch_site_key_normalizes_common_subdomains() -> None:
|
||||
assert fetch_site_key("https://www.rf4db.com/") == "rf4db.com"
|
||||
# Base domain stays the same
|
||||
assert fetch_site_key("https://rf4db.com/") == "rf4db.com"
|
||||
assert fetch_site_key("https://gw.rf4map.ru/public/images/fish.webp") == "rf4map.ru"
|
||||
# Non-normalized subdomains stay as-is
|
||||
assert fetch_site_key("https://rf4map.ru/point/1") == "rf4map.ru"
|
||||
assert fetch_site_key("https://rf4-posts.com/spots/") == "rf4-posts.com"
|
||||
|
||||
@@ -34,6 +34,14 @@ def test_gallery_page_provenance_classifies_generic_asset_urls() -> None:
|
||||
assert chrome[0].entity_type == "reference"
|
||||
|
||||
|
||||
def test_rf4map_gateway_fish_filename_is_classified_as_fish() -> None:
|
||||
items = extract_media_candidates(
|
||||
'<img src="https://gw.rf4map.ru/public/images/fish_123.webp" alt="Ерш">',
|
||||
source_page="https://rf4map.ru/fishes",
|
||||
)
|
||||
assert items[0].entity_type == "fish"
|
||||
|
||||
|
||||
def test_manifest_merges_and_binary_store_is_content_addressed(tmp_path: Path) -> None:
|
||||
item = extract_media_candidates('<img src="/bait/worm.png" alt="Bait worm">', source_page="https://example.test")[0]
|
||||
first = merge_manifest(tmp_path / "manifest.json", [item])
|
||||
|
||||
Reference in New Issue
Block a user