mirror of
https://github.com/vinta/awesome-python.git
synced 2026-07-11 02:03:46 +00:00
feat(website): assert unique slugs across categories and groups
Categories and groups will share the /categories/ URL namespace. Fail the build with a clear error message if a future README change introduces a collision. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a46b57e428
commit
583d5e7c51
2 changed files with 30 additions and 0 deletions
|
|
@ -484,6 +484,27 @@ class TestBuild:
|
|||
# Expand content present
|
||||
assert "expand-content" in html
|
||||
|
||||
def test_build_fails_when_group_and_category_slug_collide(self, tmp_path):
|
||||
readme = textwrap.dedent("""\
|
||||
# T
|
||||
|
||||
---
|
||||
|
||||
**Widgets**
|
||||
|
||||
## Widgets
|
||||
|
||||
- [w1](https://example.com) - W.
|
||||
|
||||
# Contributing
|
||||
|
||||
Done.
|
||||
""")
|
||||
self._make_repo(tmp_path, readme)
|
||||
import pytest
|
||||
with pytest.raises(ValueError, match="slug collision"):
|
||||
build(tmp_path)
|
||||
|
||||
def test_index_contains_aligned_homepage_metadata(self, tmp_path):
|
||||
readme = (Path(__file__).parents[2] / "README.md").read_text(encoding="utf-8")
|
||||
(tmp_path / "README.md").write_text(readme, encoding="utf-8")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue