mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-13 16:37:59 +00:00
test(website): restore exact sitemap URL list and lastmod count check
Membership-only assertions wouldn't catch phantom URLs added by future build changes. Tighten back to an exact-list assertion now that we know the fixture's exact output, and assert lastmod count tracks loc count. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fe7fd35e18
commit
e320ba7278
1 changed files with 7 additions and 4 deletions
|
|
@ -229,10 +229,13 @@ class TestBuild:
|
|||
lastmods = [lastmod.text for lastmod in root.findall("sitemap:url/sitemap:lastmod", ns)]
|
||||
|
||||
assert root.tag == "{http://www.sitemaps.org/schemas/sitemap/0.9}urlset"
|
||||
assert "https://awesome-python.com/" in locs
|
||||
assert "https://awesome-python.com/categories/widgets/" in locs
|
||||
assert "https://awesome-python.com/categories/tools/" in locs
|
||||
assert "https://awesome-python.com/categories/widgets/sync/" in locs
|
||||
assert locs == [
|
||||
"https://awesome-python.com/",
|
||||
"https://awesome-python.com/categories/widgets/",
|
||||
"https://awesome-python.com/categories/tools/",
|
||||
"https://awesome-python.com/categories/widgets/sync/",
|
||||
]
|
||||
assert len(lastmods) == len(locs)
|
||||
assert all(start_date <= date.fromisoformat(lastmod) <= end_date for lastmod in lastmods)
|
||||
assert all(loc.startswith("https://awesome-python.com/") for loc in locs)
|
||||
assert all("?" not in loc for loc in locs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue