MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_sitemap

Function test_sitemap

tests/unit/_utils/test_sitemap.py:79–87  ·  view source on GitHub ↗

Test loading a basic sitemap.

(server_url: URL, http_client: HttpClient)

Source from the content-addressed store, hash-verified

77
78
79async def test_sitemap(server_url: URL, http_client: HttpClient) -> None:
80 """Test loading a basic sitemap."""
81 sitemap_url = (server_url / 'sitemap.xml').with_query(
82 base64=encode_base64(get_basic_sitemap(url=server_url).encode()), c_type='application/xml; charset=utf-8'
83 )
84 sitemap = await Sitemap.load(str(sitemap_url), http_client=http_client)
85
86 assert len(sitemap.urls) == 5
87 assert set(sitemap.urls) == get_basic_results(server_url)
88
89
90async def test_sitemap_different_url(server_url: URL, http_client: HttpClient) -> None:

Callers

nothing calls this directly

Calls 4

get_basic_sitemapFunction · 0.90
get_basic_resultsFunction · 0.90
encode_base64Function · 0.70
loadMethod · 0.45

Tested by

no test coverage detected