Skip to content

test: Level 0 negative conformance cases#15

Merged
imran-siddique merged 1 commit into
mainfrom
test/level0-negative-cases
Jun 13, 2026
Merged

test: Level 0 negative conformance cases#15
imran-siddique merged 1 commit into
mainfrom
test/level0-negative-cases

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Summary

  • Adds tests/test_level0_negative.py with 19 negative tests covering bad digest format, future iat, unknown platform, slsa_level out of range, http:// transparency URI, and missing required fields (build_provenance, transparency).
  • Each test mutates exactly one field from a valid fixture and asserts a ValidationError (schema path) or a FAIL Finding (conformance module path).
  • missing runtime is not duplicated -- already covered in test_schema.py::test_missing_runtime_rejected.
  • appraisal.status: contraindicated + enforcement_mode: enforce combination skipped -- no module in the spec defines a rule for this combination.

Test plan

  • python -m pytest tests/test_level0_negative.py -v -- 19/19 passed
  • python -m pytest -q -- 105 passed (86 pre-existing + 19 new), 5 xpassed

Generated with Claude Code

Add tests/test_level0_negative.py with 19 negative tests covering:
- Bad digest format (sha512 prefix, wrong hex length) on build_provenance.digest
  and tool_transcript.hash at both schema and conformance levels
- iat in the future (now+3600) rejected by TR-ENV-002
- Unknown platform value ("quantum-chip") rejected by schema enum and TR-RTE-001
- slsa_level out of range (4 and -1) rejected by schema and TR-SCA-001
- transparency with http:// rejected by TR-ANC-001
- Missing build_provenance and missing transparency rejected by schema/conformance
  (missing runtime already covered in test_schema.py, not duplicated)

All 86 existing tests still pass; total suite is 105 passed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imran-siddique imran-siddique merged commit ee4b6dd into main Jun 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant