mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-24 04:39:06 -05:00
fix: check the event schema under the given root
validate_schemas.py read install-events.schema.json from the real tree while a test pointed ROOT at a scratch one, and test_schema_semantic_gate.py called unittest.main() before its last class.
This commit is contained in:
1 parent
b34a6058f7
commit
7143d20ef8
2 files changed
+6
-6
No files matched your search
@@ -558,7 +558,7 @@ def _event_schema_errors() -> list[str]:
|
||||
"""install-events.schema.json is EVENT_KEYS written out, and a valid schema."""
|
||||
import generate_event_schema # noqa: PLC0415
|
||||
|
||||
path = generate_event_schema.OUTPUT
|
||||
path = ROOT / "schemas" / generate_event_schema.OUTPUT.name
|
||||
label = path.relative_to(ROOT).as_posix()
|
||||
if not path.is_file():
|
||||
return [f"{label}: missing, run python scripts/generate_event_schema.py"]
|
||||
@@ -567,7 +567,7 @@ def _event_schema_errors() -> list[str]:
|
||||
):
|
||||
return [f"{label}: differs from EVENT_KEYS in install.py, run "
|
||||
"python scripts/generate_event_schema.py"]
|
||||
_validator(path.name)
|
||||
Draft202012Validator.check_schema(_load_json(path))
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -94,10 +94,6 @@ class SemanticManifestValidation(unittest.TestCase):
|
||||
self.assertIn("total_files does not equal len(files)", errors[0])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
try:
|
||||
import jsonschema
|
||||
except ImportError:
|
||||
@@ -122,3 +118,7 @@ class DataRootIsKeyedBySystem(unittest.TestCase):
|
||||
self.assertTrue(self._errors({"amiga": {"path": "x", "source_ref": "y"}}))
|
||||
self.assertTrue(self._errors({"windows": {"path": "%APPDATA%/X"}}))
|
||||
self.assertTrue(self._errors({}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user