mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 20:08:51 -06:00
refactor: read retrobat es_systems.cfg once
This commit is contained in:
1 parent
3eb6bd81a1
commit
f245c210e0
5 files changed
+58
-89
No files matched your search
@@ -131,12 +131,12 @@ class AnEmulatorLaunchedBothWaysGetsBothLayouts(unittest.TestCase):
|
||||
|
||||
def test_retrobat_and_recalbox_name_theirs(self):
|
||||
from scripts.scraper.recalbox_scraper import system_ini_cores, system_ini_libretro
|
||||
from scripts.scraper.retrobat_scraper import es_systems_dual
|
||||
from scripts.scraper.es_emulators import es_cores, xml_systems
|
||||
|
||||
cfg = ("<systemList><system><emulators>"
|
||||
cfg = ("<systemList><system><name>gamecube</name><emulators>"
|
||||
"<emulator name=\"libretro\"><cores><core>dolphin</core></cores></emulator>"
|
||||
"<emulator name=\"dolphin\"/></emulators></system></systemList>")
|
||||
self.assertEqual(es_systems_dual(cfg), {"dolphin"})
|
||||
self.assertEqual(es_cores(xml_systems(cfg), {"libretro": None})[2], ["dolphin"])
|
||||
ini = "[core.0]\nemulator = libretro\ncore = dolphin\n[core.1]\nemulator = dolphin\ncore = dolphin\n"
|
||||
_cores, standalone = system_ini_cores(ini)
|
||||
self.assertEqual(system_ini_libretro(ini) & standalone, {"dolphin"})
|
||||
|
||||
@@ -811,7 +811,7 @@ class TheScrapersReadTheSystemLists(unittest.TestCase):
|
||||
{"dolphin": ["gamecube", "wii"], "stella": ["atari2600"]})
|
||||
|
||||
def test_retrobat_es_systems_cfg(self):
|
||||
from scripts.scraper.retrobat_scraper import es_systems_libretro_systems
|
||||
from scripts.scraper.es_emulators import libretro_systems, xml_systems
|
||||
|
||||
text = (
|
||||
"<systemList><system><name>3ds</name><emulators>"
|
||||
@@ -820,7 +820,7 @@ class TheScrapersReadTheSystemLists(unittest.TestCase):
|
||||
"<emulator name=\"citra-qt\"><cores><core>citra-qt</core></cores></emulator>"
|
||||
"</emulators></system></systemList>"
|
||||
)
|
||||
self.assertEqual(es_systems_libretro_systems(text), {"azahar": ["3ds"]})
|
||||
self.assertEqual(libretro_systems(xml_systems(text)), {"azahar": ["3ds"]})
|
||||
|
||||
def test_recalbox_system_ini(self):
|
||||
from scripts.scraper.recalbox_scraper import libretro_systems
|
||||
|
||||
@@ -477,11 +477,28 @@ class RetroBatCoresFromItsES(unittest.TestCase):
|
||||
"""
|
||||
|
||||
def test_libretro_cores_and_standalone_emulators(self):
|
||||
from scraper.retrobat_scraper import es_systems_cores
|
||||
from scraper.es_emulators import es_cores, xml_systems
|
||||
|
||||
cores, standalone = es_systems_cores(self.ES_SYSTEMS)
|
||||
self.assertEqual(cores, {"snes9x", "bsnes", "simcoupe"})
|
||||
self.assertEqual(standalone, {"bsnes", "simcoupe"})
|
||||
cores, standalone, dual = es_cores(xml_systems(self.ES_SYSTEMS), {"libretro": None})
|
||||
self.assertEqual(cores, ["bsnes", "simcoupe", "snes9x"])
|
||||
self.assertEqual(standalone, ["bsnes", "simcoupe"])
|
||||
self.assertEqual(dual, ["bsnes"])
|
||||
|
||||
def test_same_named_systems_keep_every_emulator(self):
|
||||
# RetroBat 8.3.1 names two <system> blocks `starship`: ghostship
|
||||
# sits under the first one only.
|
||||
from scraper.es_emulators import es_cores, xml_systems
|
||||
|
||||
text = (
|
||||
"<systemList>"
|
||||
"<system><name>starship</name><emulators>"
|
||||
"<emulator name=\"ghostship\"/></emulators></system>"
|
||||
"<system><name>starship</name><emulators>"
|
||||
"<emulator name=\"starship\"/></emulators></system>"
|
||||
"</systemList>"
|
||||
)
|
||||
_cores, standalone, _dual = es_cores(xml_systems(text), {"libretro": None})
|
||||
self.assertEqual(standalone, ["ghostship", "starship"])
|
||||
|
||||
def test_the_registry_leaves_the_list_to_the_scraper(self):
|
||||
import yaml
|
||||
|
||||
Reference in new issue
Block a user