Run generation tests through validator

Keep the existing workflow unchanged while making schema validation self-contained when jsonschema is unavailable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bd6344b4-eafd-4a58-a1c9-5a2d96fa2938
This commit is contained in:
Jesper Schulz-Wedde 2026-07-14 13:45:28 +02:00
parent b0d71418fa
commit fbf5d7ec93
4 changed files with 167 additions and 9 deletions

View file

@ -11,6 +11,7 @@ import yaml
from generation_contracts import (
MAX_ARTIFACT_BYTES,
_fallback_schema_errors,
load_bounded_json,
load_schema,
schema_errors,
@ -93,6 +94,8 @@ class GenerationContractTests(unittest.TestCase):
self.assertEqual([], validate_requirement_semantics(VALID_REQUIREMENT))
self.assertEqual([], schema_errors(REPORT_SCHEMA, VALID_REPORT))
self.assertEqual([], validate_report_semantics(VALID_REPORT, requirement=VALID_REQUIREMENT))
self.assertEqual([], _fallback_schema_errors(REQUIREMENT_SCHEMA, VALID_REQUIREMENT))
self.assertEqual([], _fallback_schema_errors(REPORT_SCHEMA, VALID_REPORT))
def test_malformed_and_duplicate_key_json_fail(self) -> None:
with tempfile.TemporaryDirectory() as directory: