Skip to content

test: add unit tests for scoring module#74

Open
beonde wants to merge 2 commits into
mainfrom
test/scoring-coverage
Open

test: add unit tests for scoring module#74
beonde wants to merge 2 commits into
mainfrom
test/scoring-coverage

Conversation

@beonde
Copy link
Copy Markdown
Member

@beonde beonde commented May 22, 2026

Summary

Add comprehensive unit tests for the scoring module (capiscio_sdk/scoring/). Previously there were zero dedicated unit tests for the scoring subsystem — only integration tests that required a running gRPC server.

Test Files

File Module Under Test Tests
test_scoring_types.py scoring/types.py Rating boundary values (parametrized), confidence multiplier, dataclass post_init validation
test_scoring_compliance.py scoring/compliance.py Perfect score, core fields (empty/partial/falsy), skills quality (missing fields/tags/non-dict), format compliance (per-issue), data quality (duplicates/SSRF), issue filtering
test_scoring_trust.py scoring/trust.py Valid/missing/invalid/expired signatures, provider (full/empty/unreachable/non-dict), security (HTTPS/schemes/strong auth), documentation, confidence multiplier application, issue filtering
test_scoring_availability.py scoring/availability.py Not-tested placeholder, perfect endpoint, response time tiers, TLS/CORS, transport support, response quality (malformed JSON/content type), issue filtering

Key Properties

  • 56 tests total, all passing
  • Pure unit tests — no network, no gRPC, no server dependencies
  • Covers all rating boundary values at enum transitions
  • Tests defensive coding paths (non-dict skills, non-list skills, non-dict provider/capabilities)
  • Verifies issue filtering: only domain-specific issues appear in each scorer's output

…ailability)

56 new tests covering:
- types.py: rating boundary values, confidence multiplier, dataclass validation
- compliance.py: perfect score, core fields, skills quality, format, data quality
- trust.py: signatures, provider, security, documentation, multiplier application
- availability.py: not-tested, primary endpoint, transport, response quality

All tests are pure unit tests with no network or server dependencies.
Copilot AI review requested due to automatic review settings May 22, 2026 14:10
@github-actions
Copy link
Copy Markdown

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link
Copy Markdown

✅ All checks passed! Ready for review.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated unit test suite for the capiscio_sdk.scoring subsystem, improving confidence in the SDK’s multi-dimensional scoring behavior without requiring any network or gRPC dependencies.

Changes:

  • Added rating/helper and dataclass validation tests for capiscio_sdk.scoring.types.
  • Added unit tests for ComplianceScorer, TrustScorer, and AvailabilityScorer, including domain-specific issue filtering.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/unit/test_scoring_types.py Verifies rating boundary helpers, confidence multiplier logic, and dataclass __post_init__ validation.
tests/unit/test_scoring_compliance.py Exercises ComplianceScorer scoring components and compliance-only issue filtering.
tests/unit/test_scoring_trust.py Exercises TrustScorer scoring components, multiplier behavior, and trust-only issue filtering.
tests/unit/test_scoring_availability.py Exercises AvailabilityScorer endpoint scoring and availability-only issue filtering.

Comment thread tests/unit/test_scoring_trust.py Outdated
Comment on lines +3 to +4
import pytest

Comment thread tests/unit/test_scoring_availability.py Outdated
Comment on lines +3 to +4
import pytest

Address review: remove unused 'import pytest' from test_scoring_trust.py
and test_scoring_availability.py.
@github-actions
Copy link
Copy Markdown

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link
Copy Markdown

✅ All checks passed! Ready for review.

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.

2 participants