mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-12 13:03:54 -06:00
fix: redirect every list part that goes away
This commit is contained in:
1 parent
4efd64be70
commit
6fb79cab6d
3 files changed
+60
-12
No files matched your search
@@ -279,6 +279,23 @@ class Redirects(unittest.TestCase):
|
||||
source = Path(generate_site.__file__).read_text(encoding="utf-8")
|
||||
self.assertIn('generated / "redirects.json"', source)
|
||||
|
||||
def test_a_list_part_gone_with_its_rows_redirects_to_its_page(self):
|
||||
"""Only platform parts were recorded: gaps-files-to-source-7, gone
|
||||
once 29 files were collected, ended on the 404 page."""
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
docs = Path(tmp)
|
||||
part = '---\nlevel: reference\nparent:\n label: "Gaps"\n link: "/gaps/"\n---\n\n# P\n'
|
||||
(docs / "gaps-files-to-source-7.md").write_text(part, encoding="utf-8")
|
||||
(docs / "gaps.md").write_text("# Gaps\n", encoding="utf-8")
|
||||
kept = {"platforms/b-atari-st.md": "platforms/b.md#atari-st"}
|
||||
published = generate_site.record_parts(
|
||||
docs, {"gaps-files-to-source-7.md", "gaps.md"}, kept)
|
||||
self.assertEqual(published, {"gaps-files-to-source-7.md": "gaps.md", **kept})
|
||||
# The next run made six parts.
|
||||
self.assertEqual(
|
||||
sitestarlight.redirects({}, {"gaps.md", "platforms/b.md"}, published),
|
||||
{"/gaps-files-to-source-7/": "/gaps/", "/platforms/b-atari-st/": "/platforms/b/#atari-st"})
|
||||
|
||||
|
||||
class PlatformShareCards(unittest.TestCase):
|
||||
def test_every_platform_page_shares_its_own_card(self):
|
||||
|
||||
Reference in new issue
Block a user