diff --git a/tests/test_site_density_cards.py b/tests/test_site_density_cards.py index 164ba30fe..56ddd41c7 100644 --- a/tests/test_site_density_cards.py +++ b/tests/test_site_density_cards.py @@ -289,7 +289,7 @@ class BuiltPagesReadInFewerWords(unittest.TestCase): def test_a_built_card_holds_its_hashes(self) -> None: if not (DIST / "systems").is_dir(): self.skipTest("no built site") - main = _main("systems/sony") + main = _main("systems/sony-playstation-portable") card = main[main.index('id="sha1-30a33f3651f8"'):] card = card[:card.index('class="rb-sys-file"')] self.assertRegex(card, r'
30a33f3651f8
') diff --git a/tests/test_site_r2_systems.py b/tests/test_site_r2_systems.py index b272f2a93..1b985c79d 100644 --- a/tests/test_site_r2_systems.py +++ b/tests/test_site_r2_systems.py @@ -128,8 +128,9 @@ class TheConsoleBiosComesFirst(unittest.TestCase): self.assertEqual(gs._start_with([_file("a.bin", "a")], _consumers({})), []) def test_the_page_carries_the_line_under_the_console(self): - page = gs.generate_system_page("Sony", {"PlayStation": self.files}, self.required_only()) - heading = page.index("## PlayStation") + # Sega keeps its consoles as sections; Sony gives each a page. + page = gs.generate_system_page("Sega", {"Saturn": self.files}, self.required_only()) + heading = page.index("## Saturn") self.assertLess(heading, page.index("**Start with**")) self.assertLess(page.index("**Start with**"), page.index('class="rb-sys-file"')) @@ -149,7 +150,7 @@ class ThePermalinkIsAnIcon(unittest.TestCase): def test_the_page_draws_the_icon_once(self): page = gs.generate_system_page( - "Sony", {"PlayStation": [_file("a.bin", "a"), _file("b.bin", "b")]}, + "Sega", {"Saturn": [_file("a.bin", "a"), _file("b.bin", "b")]}, FileConsumers({"files": {}})) self.assertEqual(page.count('"]) def test_the_page_defines_both_lines(self): - page = gs.generate_system_page("Sony", {"PlayStation": [_file("scph5501.bin", "4")]}, + page = gs.generate_system_page("Sega", {"Saturn": [_file("scph5501.bin", "4")]}, self.consumers) key = page.index("**On the setup's list** names") self.assertLess(key, page.index('class="rb-sys-file"')) @@ -294,7 +295,9 @@ class TheBuiltSonyPage(unittest.TestCase): self.text = (DIST / "systems" / "sony" / "index.html").read_text(encoding="utf-8") def test_no_card_title_says_permalink(self): - titles = re.findall(r']*class="rb-file-title".*?', self.text, re.S) + # Every Sony console has a page of its own: the cards are there. + own = (DIST / "systems" / "sony-playstation" / "index.html").read_text(encoding="utf-8") + titles = re.findall(r']*class="rb-file-title".*?', own, re.S) self.assertTrue(titles) for title in titles: self.assertNotIn("permalink", re.sub(r"<[^>]+>", "", title)) diff --git a/tests/test_site_r4_systems.py b/tests/test_site_r4_systems.py index d5fcded22..502815e68 100644 --- a/tests/test_site_r4_systems.py +++ b/tests/test_site_r4_systems.py @@ -282,17 +282,22 @@ class ConsolesFieldNamesMachinesOnce(unittest.TestCase): self.assertEqual(_consoles(page[gs._slug(maker)][0]), [], maker) def test_a_console_with_its_own_page_is_left_to_it(self) -> None: - big = [_file(f"r{i:02}.bin", "0123456789"[i], f"bios/Sony/PlayStation/r{i:02}.bin") + big = [_file(f"r{i:02}.bin", "0123456789"[i], f"bios/Sega/Saturn/r{i:02}.bin") for i in range(10)] - small = [_file("pocket.bin", "p", "bios/Sony/PocketStation/pocket.bin")] + small = [_file("pico.bin", "p", "bios/Sega/Pico/pico.bin")] consumers = _consumers({}) with gs.markup.using("mkdocs"): one = sum(len(line) + 1 for line in gs._system_file_card(big[0], consumers)) - pages = gs.system_pages("Sony", {"PlayStation": big, "PocketStation": small}, + # Sega splits by size; every Sony console has a page whatever its size. + pages = gs.system_pages("Sega", {"Saturn": big, "Pico": small}, consumers, budget=one * 12) - self.assertIn("sony-playstation", pages) - self.assertEqual(_consoles(pages["sony"][0]), ["PocketStation"]) - self.assertEqual(_consoles(pages["sony-playstation"][0]), ["PlayStation"]) + self.assertIn("sega-saturn", pages) + self.assertEqual(_consoles(pages["sega"][0]), ["Pico"]) + self.assertEqual(_consoles(pages["sega-saturn"][0]), ["Saturn"]) + sony = gs.system_pages("Sony", {"PlayStation": big, "PocketStation": small}, + consumers, budget=one * 12) + self.assertEqual(_consoles(sony["sony"][0]), []) + self.assertEqual(_consoles(sony["sony-pocketstation"][0]), ["PocketStation"]) class OneLineBeforeTheFirstConsole(unittest.TestCase): diff --git a/tests/test_site_r5_search.py b/tests/test_site_r5_search.py index ac8c752f4..bdaecd268 100644 --- a/tests/test_site_r5_search.py +++ b/tests/test_site_r5_search.py @@ -189,7 +189,8 @@ class GateQueries(unittest.TestCase): "3ds bios": (("systems/nintendo-3ds/",), 1), "playstation bios": (("systems/sony-playstation/",), 1), "playstation 2 bios": (("systems/sony-playstation-2/",), 1), - "playstation 3 bios": (("systems/sony/",), 1), + "playstation 3 bios": (("systems/sony-playstation-3/",), 2), + "ps3 bios": (("systems/sony-playstation-3/",), 1), "game boy advance bios": (("systems/nintendo/",), 1), "game boy color bios": (("systems/nintendo/",), 1), "nintendo ds bios": (("systems/nintendo-nintendo-ds/",), 1),