You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.9 KiB
53 lines
1.9 KiB
"""Tests for agent content validation primitives."""
|
|
|
|
import pytest
|
|
|
|
pytest.importorskip("duckdb")
|
|
|
|
|
|
class TestValidateMotionCoverage:
|
|
def test_returns_coverage_gaps(self, tmp_duckdb_path):
|
|
from agent_tools.content import validate_motion_coverage
|
|
|
|
result = validate_motion_coverage(tmp_duckdb_path, start_date="2024-01-01", end_date="2024-12-31")
|
|
assert isinstance(result, dict)
|
|
assert "gaps" in result
|
|
assert "coverage_rate" in result or "error" in result
|
|
|
|
|
|
class TestValidateLaymanExplanations:
|
|
def test_returns_quality_report(self, tmp_duckdb_path):
|
|
from agent_tools.content import validate_layman_explanations
|
|
|
|
result = validate_layman_explanations(tmp_duckdb_path, sample_size=5)
|
|
assert isinstance(result, dict)
|
|
assert "sample_size" in result
|
|
assert "coverage" in result or "error" in result
|
|
|
|
|
|
class TestSuggestSvdLabel:
|
|
def test_returns_suggestion(self, tmp_duckdb_path):
|
|
from agent_tools.content import suggest_svd_label
|
|
|
|
result = suggest_svd_label(tmp_duckdb_path, component=1, top_n=5)
|
|
assert isinstance(result, dict)
|
|
assert "component" in result
|
|
assert "suggestion" in result or "error" in result
|
|
|
|
|
|
class TestCheckEmbeddingQuality:
|
|
def test_returns_coverage_stats(self, tmp_duckdb_path):
|
|
from agent_tools.content import check_embedding_quality
|
|
|
|
result = check_embedding_quality(tmp_duckdb_path, window_id="current_parliament")
|
|
assert isinstance(result, dict)
|
|
assert "coverage" in result or "error" in result
|
|
|
|
def test_parameterized_threshold(self, tmp_duckdb_path):
|
|
from agent_tools.content import check_embedding_quality
|
|
|
|
result = check_embedding_quality(
|
|
tmp_duckdb_path, window_id="current_parliament", healthy_threshold=0.5
|
|
)
|
|
assert isinstance(result, dict)
|
|
assert result.get("healthy_threshold") == 0.5
|
|
|