diff --git a/scripts/validate_schemas.py b/scripts/validate_schemas.py index 57bf5bfa..1a3b888c 100644 --- a/scripts/validate_schemas.py +++ b/scripts/validate_schemas.py @@ -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 [] diff --git a/tests/test_schema_semantic_gate.py b/tests/test_schema_semantic_gate.py index 746d2822..2710455a 100644 --- a/tests/test_schema_semantic_gate.py +++ b/tests/test_schema_semantic_gate.py @@ -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()