Test loading a basic sitemap when sitemap contains links to different url. Those should be ignored.
(server_url: URL, http_client: HttpClient)
| 88 | |
| 89 | |
| 90 | async def test_sitemap_different_url(server_url: URL, http_client: HttpClient) -> None: |
| 91 | """Test loading a basic sitemap when sitemap contains links to different url. Those should be ignored.""" |
| 92 | different_url = 'https://other.com/' |
| 93 | sitemap_url = (server_url / 'sitemap.xml').with_query( |
| 94 | base64=encode_base64(get_basic_sitemap(url=different_url).encode()), c_type='application/xml; charset=utf-8' |
| 95 | ) |
| 96 | sitemap = await Sitemap.load(str(sitemap_url), http_client=http_client) |
| 97 | |
| 98 | assert len(sitemap.urls) == 0 |
| 99 | |
| 100 | |
| 101 | async def test_sitemap_different_url_allowed(server_url: URL, http_client: HttpClient) -> None: |
nothing calls this directly
no test coverage detected