Files
AI/tests/test_site_crawler.py

12 lines
482 B
Python
Raw Normal View History

2026-05-11 13:02:11 +09:00
from crawler_platform.app.core.crawler.site_crawler import classify_page, normalize_url
def test_classify_perfume_product_page():
text = "Top notes: Bergamot, Neroli\nMiddle notes: Jasmine\nBase notes: Musk\nPrice $89"
assert classify_page("https://example.com/products/neroli", "Neroli Summer", text) == "product"
def test_normalize_url_removes_fragment_and_trailing_slash():
assert normalize_url("https://example.com/path/#details") == "https://example.com/path"