mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-03 14:58:51 -06:00
Fifteen modules imported FakeRepository from test_install_selection, and others read fixtures from test_install_app, test_install_offline, test_install_games, test_launchers, test_prose_style, test_site_nav, test_site_pronouns and test_site_copy. Those now live in installsupport, gamessupport, launcherssupport, docpagessupport, sitepages and sitecopy, and test_layers refuses an import of a test module. sitereferencesupport and the DIST each site module defined merge into sitepages, launchersretrobatsupport into launcherssupport, auditsupport into the tests package (REPO_ROOT, HAS_JSONSCHEMA). test_launchers is the Batocera module and becomes test_launchers_batocera. test_port becomes test_handheld_port: its archive checks repeated test_handheld_scripts, whose TheArchives now holds the port.json assertions. The testing guide splits the row that held 113 modules, replaces the e2e number ranges by a module table, gives package imports and scratch_dir in How to add a test, lists every module that reads the working tree and every helper module. Its guard moves to test_doc_pages_tools and checks each module on one row once and each family on one row. The guide and tools.md join the pages whose cited paths and options are looked up.
27 lines
794 B
Python
27 lines
794 B
Python
"""Source texts the launcher test modules build: blocks placed at their lines, C# files by path."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import tests
|
|
|
|
import textwrap
|
|
|
|
from scraper.csharp_source import Source
|
|
|
|
|
|
def placed(blocks: dict[int, str]) -> str:
|
|
"""Each block starting at its line, blank lines between."""
|
|
lines: list[str] = []
|
|
for start, block in sorted(blocks.items()):
|
|
if len(lines) >= start:
|
|
raise AssertionError(f"block at line {start} overlaps the previous one")
|
|
lines += [""] * (start - 1 - len(lines))
|
|
lines += block.splitlines()
|
|
return "\n".join(lines) + "\n"
|
|
|
|
|
|
def _sources(**texts: str) -> dict[str, Source]:
|
|
return {
|
|
path: Source(path, textwrap.dedent(text).lstrip("\n")) for path, text in texts.items()
|
|
}
|