mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 10:37:54 -06:00
refactor: site commands keep only their options
This commit is contained in:
1 parent
206dae3163
commit
231002a7c0
49 files changed
+4354
-4290
No files matched your search
@@ -17,6 +17,7 @@ from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
import generate_readme
|
||||
from sitegen import readme
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
@@ -33,8 +34,8 @@ class CoverageCache(unittest.TestCase):
|
||||
self.db.write_text("{}")
|
||||
self.calls: list[str] = []
|
||||
patches = [
|
||||
mock.patch.object(generate_readme, "COVERAGE_CACHE_DIR", self.work / "cache"),
|
||||
mock.patch.object(generate_readme, "compute_coverage", self._compute),
|
||||
mock.patch.object(readme, "COVERAGE_CACHE_DIR", self.work / "cache"),
|
||||
mock.patch.object(readme, "compute_coverage", self._compute),
|
||||
]
|
||||
for patch in patches:
|
||||
patch.start()
|
||||
@@ -52,7 +53,7 @@ class CoverageCache(unittest.TestCase):
|
||||
return {"platform": name.title(), "missing_names": {"a.bin"}}
|
||||
|
||||
def _run(self, names=("beta", "alpha")) -> dict:
|
||||
return generate_readme.platform_coverages(
|
||||
return readme.platform_coverages(
|
||||
list(names), str(self.platforms), {}, {},
|
||||
emulators_dir=str(self.emulators), db_path=str(self.db),
|
||||
)
|
||||
@@ -121,8 +122,8 @@ class CoverageCache(unittest.TestCase):
|
||||
def missing(*_args, **_kwargs):
|
||||
raise generate_readme.InputMissing("no emulator profile directory at nosuch")
|
||||
|
||||
with mock.patch.object(generate_readme, "compute_coverage", missing), \
|
||||
mock.patch.object(generate_readme, "_coverage_inputs", return_value="other"), \
|
||||
with mock.patch.object(readme, "compute_coverage", missing), \
|
||||
mock.patch.object(readme, "_coverage_inputs", return_value="other"), \
|
||||
self.assertRaises(generate_readme.InputMissing):
|
||||
self._run()
|
||||
self.assertEqual(sorted((self.work / "cache").glob("*.pickle")), kept)
|
||||
|
||||
Reference in new issue
Block a user