fix: prioritize media URL classification
This commit is contained in:
@@ -42,6 +42,14 @@ def test_rf4map_gateway_fish_filename_is_classified_as_fish() -> None:
|
||||
assert items[0].entity_type == "fish"
|
||||
|
||||
|
||||
def test_tackle_path_wins_over_fish_word_in_product_name() -> None:
|
||||
items = extract_media_candidates(
|
||||
'<img src="https://cdn.example/bait/crab.png" alt="Краб и рыба 14">',
|
||||
source_page="https://example.test/fishes",
|
||||
)
|
||||
assert items[0].entity_type == "tackle"
|
||||
|
||||
|
||||
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