refactor: place systems by the section index

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:02:44 +01:00
1 parent e79d2404bc
commit 437690d4a8
3 files changed
+61 -48

No files matched your search

+11
View File
@@ -115,6 +115,17 @@ class OtherSpellingsOfOneSystem(unittest.TestCase):
manufacturers, {}, {"files": {}, "indexes": {}}, profiles)
self.assertEqual(pages["commodore-pet"], ("commodore", "PET"))
def test_two_folders_spelled_alike_go_to_the_maker_the_id_names(self):
"""Atari and Camputers both file a Lynx: the system names agreed on
Atari's while the placement found no folder by its name."""
from model.systemnames import console_index
index = places._FolderIndex(
{"files": {}, "indexes": {}}, {},
console_index({("Atari", "Lynx"), ("Camputers", "Lynx")}), {})
self.assertEqual(index.place("atari-lynx", []), ("atari", "Lynx"))
self.assertIsNone(index.place("lynx", []))
class ACopyIsOnItsOwnFoldersPage(unittest.TestCase):
"""The database keeps one path per content: the Channel F BIOS was on the