mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
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:
parent
b0d71418fa
commit
fbf5d7ec93
4 changed files with 167 additions and 9 deletions
3
.github/scripts/test_generation_contracts.py
vendored
3
.github/scripts/test_generation_contracts.py
vendored
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue