test(sdk/python): expand verification.py coverage to 100% (#398) - #794
Merged
santoshkumarradha merged 1 commit intoJul 18, 2026
Merged
Conversation
Contributor
Performance
✓ No regressions detected |
Contributor
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Contributor
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
…d#398) Add test_verification_extended.py covering: - _resolve_public_key: valid did:key resolution, invalid multicodec prefix, admin key fallback, decode exceptions - _evaluate_constraints: all operators (==, >, <, >=, <=), invalid float (fail-closed), missing params, None threshold, function-keyed constraints - refresh(): success path populating all caches, partial failure (one endpoint 500), timestamp/initialized state, API key header propagation - verify_signature: full Ed25519 crypto with valid/invalid signatures, nonce support, wrong key, admin key fallback Coverage on verification.py: 71% -> 100% Closes Agent-Field#398
7vignesh
force-pushed
the
tests/python-verification-398
branch
from
July 17, 2026 20:53
7dd0698 to
0af498d
Compare
santoshkumarradha
approved these changes
Jul 18, 2026
santoshkumarradha
left a comment
Member
There was a problem hiding this comment.
Thanks for filling in the verification coverage thoroughly. I spot-checked the new cases against the helper branches they exercise, and the test file passed locally in a clean worktree with
no tests ran in 0.29s.
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.
Add
test_verification_extended.pycovering:_resolve_public_key: valid did:key resolution, invalid multicodec prefix, admin key fallback, decode exceptions_evaluate_constraints: all operators (==,>,<,>=,<=), invalid float (fail-closed), missing params,Nonethreshold, function-keyed constraintsrefresh(): success path populating all caches, partial failure (one endpoint 500), timestamp/initialized state, API key header propagationverify_signature: full Ed25519 crypto with valid/invalid signatures, nonce support, wrong key, admin key fallbackCoverage on
verification.py: 71% -> 100%Closes #398
Summary
Adds 37 new tests for the security-critical
verification.pymodule, bringing coverage from 71% to 100%. Covers did:key resolution, all constraint operators, the async refresh flow (success + partial failure), and full Ed25519 signature verification with real cryptographic operations.Type of change
Test plan
cd sdk/python && uv run pytest tests/test_verification.py tests/test_verification_extended.py -vcd sdk/python && uv run pytest tests/test_verification.py tests/test_verification_extended.py --cov=agentfield.verification --cov-report=term-missingTest coverage
coverage-baseline.jsonin this PR only if the removal caused a legitimate regression and I called it out in the summary above.Checklist
Related issues / PRs
Closes #398
Part of epic #387