mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 06:18:51 -06:00
refactor: make names shared across modules public
This commit is contained in:
1 parent
c3b67d5485
commit
61e302d8f6
45 files changed
+653
-653
No files matched your search
@@ -1204,13 +1204,13 @@ class HashInputNamesWhatItAccepts(unittest.TestCase):
|
||||
def test_the_truth_anchors_a_sha256_only_entry(self):
|
||||
"""rust_dos and ares name files by sha256 alone: the truth left their
|
||||
md5 empty, so md5 platforms never received them."""
|
||||
from scripts.resolve.truthsystems import _enrich_hashes
|
||||
from scripts.resolve.truthsystems import enrich_hashes
|
||||
|
||||
db = {"files": {"s" * 40: {"sha1": "s" * 40, "md5": "m" * 32, "sha256": "f" * 64,
|
||||
"crc32": "0badf00d", "size": 16}},
|
||||
"indexes": {"by_sha256": {"f" * 64: "s" * 40}}}
|
||||
entry = {"name": "5200.rom", "sha256": "F" * 64}
|
||||
_enrich_hashes(entry, db)
|
||||
enrich_hashes(entry, db)
|
||||
self.assertEqual((entry["md5"], entry["sha1"], entry["size"]), ("m" * 32, "s" * 40, 16))
|
||||
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ class TestMameMerge(unittest.TestCase):
|
||||
The manager set loads "01", but written unquoted it re-parses as the
|
||||
integer 1 and the profile stops naming the file the driver opens.
|
||||
"""
|
||||
from scripts.scraper._hash_write import _append_new_entries, _format_contents
|
||||
from scripts.scraper._hash_write import _append_new_entries, format_contents
|
||||
|
||||
contents = [
|
||||
{"name": "01", "description": "ROM bank 0-1", "size": 8192,
|
||||
@@ -264,7 +264,7 @@ class TestMameMerge(unittest.TestCase):
|
||||
"crc32": "46489d88"},
|
||||
]
|
||||
document = yaml.safe_load(
|
||||
"files:\n - name: manager.zip\n" + _format_contents(contents)
|
||||
"files:\n - name: manager.zip\n" + format_contents(contents)
|
||||
)
|
||||
names = [rom["name"] for rom in document["files"][0]["contents"]]
|
||||
self.assertEqual(names, ["01", "23"])
|
||||
|
||||
@@ -27,7 +27,7 @@ from resolve.launcherconfig import (
|
||||
)
|
||||
from resolve.launchers import handed_directories
|
||||
from resolve.launcherplaces import launcher_places
|
||||
from profiling.reportinputs import _check_build_refs
|
||||
from profiling.reportinputs import check_build_refs
|
||||
from profiling.repos import shipped_build_holders
|
||||
from scraper.retrobat_launchers import _choices_apart
|
||||
from scraper.shell_launchers import LauncherPatternMissing, Script, config_placement
|
||||
@@ -372,7 +372,7 @@ class BuildRefs(unittest.TestCase):
|
||||
asked.append((revision, path))
|
||||
return ["line"] * 5 if path == "src/a.c" else None
|
||||
|
||||
rows = _check_build_refs(
|
||||
rows = check_build_refs(
|
||||
document,
|
||||
[(Citation("src/a.c:2", "c"), document["config_reads"][0]),
|
||||
(Citation("src/a.c:9, ROCKNIX x.patch:1", "k"), document["config_reads"][0])],
|
||||
@@ -404,7 +404,7 @@ class BuildRefs(unittest.TestCase):
|
||||
asked.append(path)
|
||||
return None
|
||||
|
||||
rows = _check_build_refs(
|
||||
rows = check_build_refs(
|
||||
{"config_reads": [read]},
|
||||
[(Citation("SSF.exe 0x10-0x20"), read), (Citation("src/a.c:3"), read)],
|
||||
[View()], fetch,
|
||||
|
||||
@@ -22,7 +22,7 @@ from scraper.retrobat_config_files import (
|
||||
desmume,
|
||||
)
|
||||
from scraper.retrobat_config_folders import eka2l1, tsugaru, dosbox_copies
|
||||
from scraper.retrobat_render import _render
|
||||
from scraper.retrobat_render import render
|
||||
from scraper.retrobat_xbox import CXBX_DATA_FOLDER, cxbx, xemu_saves
|
||||
from scraper.csharp_source import LauncherPatternMissing, Source
|
||||
from tests.launchersretrobatsupport import G, _sources
|
||||
@@ -782,7 +782,7 @@ class EveryBiosReferenceIsRead(unittest.TestCase):
|
||||
"x.cs",
|
||||
'void f(string rom)\n{\n string p = AppConfig.GetFullPath("bios") + ";" + Path.GetDirectoryName(rom);\n}\n',
|
||||
)
|
||||
self.assertEqual(_render(src, "p", 0, len(src.text))[0], "bios;<rom directory>")
|
||||
self.assertEqual(render(src, "p", 0, len(src.text))[0], "bios;<rom directory>")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -552,7 +552,7 @@ class Scrapers(unittest.TestCase):
|
||||
|
||||
def test_retrobat_bios_path_setting(self) -> None:
|
||||
from scraper import retrobat_generators
|
||||
from scraper.retrobat_config_files import _value_writes
|
||||
from scraper.retrobat_config_files import value_writes
|
||||
from scraper.csharp_source import Source
|
||||
|
||||
path = f"{retrobat_generators.GENERATORS}/Flycast.Generator.cs"
|
||||
@@ -568,7 +568,7 @@ class Scrapers(unittest.TestCase):
|
||||
}
|
||||
}
|
||||
""")
|
||||
records = _value_writes(Source(path, text), "flycast", "standalone")
|
||||
records = value_writes(Source(path, text), "flycast", "standalone")
|
||||
self.assertEqual([r["search_dir"] for r in records], ["bios/dc"])
|
||||
self.assertIn("Dreamcast.BiosPath", records[0]["passes_to"])
|
||||
|
||||
|
||||
@@ -338,16 +338,16 @@ class ASizeOutsideARangeIsAnotherFile(unittest.TestCase):
|
||||
def test_exact_sizes_and_a_window_admit_both(self):
|
||||
"""An entry admits its exact sizes and the window declared beside
|
||||
them, as size_refusal reads it. Two windows with no common size clash."""
|
||||
from resolve.truthsystems import _sizes_clash
|
||||
from resolve.truthsystems import sizes_clash
|
||||
|
||||
disk = {"size": [143360, 143403, 143488], "min_size": 143105, "max_size": 143364}
|
||||
self.assertFalse(_sizes_clash(disk, {"size": 143200}))
|
||||
self.assertFalse(_sizes_clash(disk, {"size": 143488}))
|
||||
self.assertTrue(_sizes_clash(disk, {"size": 143400}))
|
||||
self.assertFalse(_sizes_clash(disk, {"min_size": 143300, "max_size": 143500}))
|
||||
self.assertTrue(_sizes_clash({"min_size": 12288, "max_size": 16384},
|
||||
self.assertFalse(sizes_clash(disk, {"size": 143200}))
|
||||
self.assertFalse(sizes_clash(disk, {"size": 143488}))
|
||||
self.assertTrue(sizes_clash(disk, {"size": 143400}))
|
||||
self.assertFalse(sizes_clash(disk, {"min_size": 143300, "max_size": 143500}))
|
||||
self.assertTrue(sizes_clash({"min_size": 12288, "max_size": 16384},
|
||||
{"min_size": 32768}))
|
||||
self.assertFalse(_sizes_clash({"min_size": 12288}, {"name": "unsized"}))
|
||||
self.assertFalse(sizes_clash({"min_size": 12288}, {"name": "unsized"}))
|
||||
|
||||
|
||||
class TruthRecordsWhoOpensByName(unittest.TestCase):
|
||||
|
||||
@@ -403,7 +403,7 @@ class PacksWordingAndDocs(unittest.TestCase):
|
||||
self.assertIn("BIOS folder:", menu)
|
||||
self.assertIn("f) copy from a folder or an old card", menu)
|
||||
# The owner's request of 2026-10-27: game data counted apart, g.
|
||||
# test_doc_pages checks that the figures add up.
|
||||
# test_doc_pages_installer checks that the figures add up.
|
||||
self.assertRegex(menu, r"\d+ BIOS files \([\d.]+ [KMG]B\)(,| and) \d+ game data files")
|
||||
self.assertRegex(menu, r"g\) Game data: kept \(\d+ files")
|
||||
env = page[page.index("## Environment overrides"):]
|
||||
|
||||
Reference in new issue
Block a user