test: Level 0 negative conformance cases#15
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_level0_negative.pywith 19 negative tests covering bad digest format, futureiat, unknown platform,slsa_levelout of range,http://transparency URI, and missing required fields (build_provenance,transparency).ValidationError(schema path) or a FAILFinding(conformance module path).missing runtimeis not duplicated -- already covered intest_schema.py::test_missing_runtime_rejected.appraisal.status: contraindicated+enforcement_mode: enforcecombination 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 passedpython -m pytest -q-- 105 passed (86 pre-existing + 19 new), 5 xpassedGenerated with Claude Code