Skip to main content

Tests for Provenance Enhancement (H.3.4).

Tests cover:

  • JudgeDecision provenance fields (H.3.4.1)
  • ConsensusResult provenance chain and dissent (H.3.4.2-H.3.4.4)
  • ClassificationResult.to_dict() with provenance (H.3.4.5)

File: test_provenance.py

Classes

TestJudgeDecisionProvenance

Tests for JudgeDecision provenance fields (H.3.4.1).

TestDissentingView

Tests for DissentingView dataclass (H.3.4.4).

TestConsensusResultProvenance

Tests for ConsensusResult provenance (H.3.4.2-H.3.4.4).

TestClassificationResultProvenance

Tests for ClassificationResult.to_dict() with provenance (H.3.4.5).

TestProvenanceSummary

Tests for provenance summary functionality.

TestProvenanceEdgeCases

Edge case tests for provenance functionality.

Functions

test_default_timestamp()

Test JudgeDecision gets timestamp on creation.

test_model_used_field()

Test model_used field.

test_token_usage_field()

Test token_usage field.

test_raw_response_field()

Test raw_response field for audit trail.

test_evaluation_timestamps()

Test evaluation start/end timestamps.

test_latency_ms_from_timestamps()

Test latency_ms calculated from start/end times.

test_latency_ms_fallback_to_duration()

Test latency_ms falls back to duration_ms.

test_dimension_scores_field()

Test dimension_scores field.

test_to_provenance_dict()

Test conversion to provenance dictionary.

test_to_provenance_dict_truncates_reason()

Test long reasons are truncated in provenance.

test_create_dissenting_view()

Test creating a dissenting view.

test_to_dict()

Test DissentingView serialization.

setUp()

Set up test fixtures.

test_build_provenance_chain()

Test building provenance chain (H.3.4.3).

test_total_token_usage()

Test total token usage calculation.

Usage

python test_provenance.py