Files
ad/tests/api/sitemap.py
T

11 lines
317 B
Python

# retoor <retoor@molodetz.nl>
from defusedxml import ElementTree
def test_robots_and_sitemap(anon):
assert "Sitemap:" in anon.get("/robots.txt").text
sitemap = anon.get("/sitemap.xml")
root = ElementTree.fromstring(sitemap.content)
assert root.tag.endswith("urlset")
assert len(list(root)) >= 5