mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 10:23:16 -05:00
fix: say on the site when a source is gone
This commit is contained in:
1 parent
8595814620
commit
63a906e1bd
2 files changed
+27
No files matched your search
@@ -2872,6 +2872,15 @@ def generate_emulator_page(
|
||||
lines.append(f"| Upstream | [{upstream}]({upstream}) |")
|
||||
else:
|
||||
lines.append(f"| Upstream | {upstream} |")
|
||||
gone = profile.get("upstream_gone")
|
||||
if gone:
|
||||
# The links above answer 451 or reach a domain someone else now
|
||||
# owns: said beside them, with the date the profile observed it.
|
||||
lines.append(f"| Source status | gone: {_escape_tags(str(gone))} |")
|
||||
mirror = profile.get("source_mirror")
|
||||
if mirror:
|
||||
lines.append(f"| Mirror | [{mirror}]({mirror}) |" if str(mirror).startswith("http")
|
||||
else f"| Mirror | {mirror} |")
|
||||
lines.append(f"| Version | {version} |")
|
||||
revision = revision_markdown(profile)
|
||||
if revision:
|
||||
|
||||
@@ -419,5 +419,23 @@ class TheGapsSayWhatToSupplyAndWhere(unittest.TestCase):
|
||||
self.assertEqual(row["expected"], "sha1:" + "a" * 40)
|
||||
|
||||
|
||||
|
||||
class AGoneSourceIsSaid(unittest.TestCase):
|
||||
"""citron, yuzu and suyu linked sources answering 451 or a domain now
|
||||
owned by someone else, and the page said nothing."""
|
||||
|
||||
def test_the_status_row(self):
|
||||
import generate_site
|
||||
|
||||
profile = {"emulator": "Citron", "type": "standalone", "systems": [],
|
||||
"source": "https://git.citron-emu.org/citron-emu/Citron",
|
||||
"upstream_gone": "git.citron-emu.org no longer resolves. Observed 2026-09-04.",
|
||||
"source_mirror": "https://example.org/mirror/Citron", "files": []}
|
||||
page = generate_site.generate_emulator_page(
|
||||
"citron", profile, {"files": {}, "indexes": {}}, {})
|
||||
self.assertIn("| Source status | gone: git.citron-emu.org no longer resolves", page)
|
||||
self.assertIn("| Mirror | [https://example.org/mirror/Citron]", page)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user