fix: update stale tests — 50 companies, normalization defaults, low-confidence thresholds

This commit is contained in:
Celes Renata
2026-04-17 03:28:22 +00:00
parent 8ac2c1ea7a
commit d80d44e2fc
3 changed files with 14 additions and 12 deletions
@@ -171,9 +171,11 @@ class TestExtractionStage:
assert len(report.errors) > 0 assert len(report.errors) > 0
def test_validate_extraction_rejects_bad_schema(self): def test_validate_extraction_rejects_bad_schema(self):
bad = {"summary": "test"} # missing required fields bad = {"summary": "test"} # missing required fields — normalized with defaults
report = validate_extraction(bad) report = validate_extraction(bad)
assert not report.valid assert report.valid
assert report.parsed is not None
assert "incomplete_model_output" in report.parsed.extraction_warnings
def test_extraction_result_matches_intelligence_schema(self): def test_extraction_result_matches_intelligence_schema(self):
result = ExtractionResult.model_validate(SAMPLE_EXTRACTION_JSON) result = ExtractionResult.model_validate(SAMPLE_EXTRACTION_JSON)
+9 -9
View File
@@ -426,11 +426,11 @@ class TestRecommendationDrivenOrders:
impacts = [ impacts = [
ImpactRow( ImpactRow(
document_id="doc-weak-1", document_id="doc-weak-1",
confidence=0.40, confidence=0.20,
novelty_score=0.3, novelty_score=0.1,
source_credibility=0.5, source_credibility=0.2,
sentiment="positive", sentiment="positive",
impact_score=0.3, impact_score=0.1,
catalyst_type="other", catalyst_type="other",
key_facts=["Minor update"], key_facts=["Minor update"],
risks=[], risks=[],
@@ -438,11 +438,11 @@ class TestRecommendationDrivenOrders:
), ),
ImpactRow( ImpactRow(
document_id="doc-weak-2", document_id="doc-weak-2",
confidence=0.35, confidence=0.15,
novelty_score=0.2, novelty_score=0.1,
source_credibility=0.4, source_credibility=0.2,
sentiment="positive", sentiment="negative",
impact_score=0.25, impact_score=0.1,
catalyst_type="other", catalyst_type="other",
key_facts=["Routine filing"], key_facts=["Routine filing"],
risks=[], risks=[],
+1 -1
View File
@@ -102,4 +102,4 @@ def test_seed_sources_have_valid_types():
def test_seed_has_ten_companies(): def test_seed_has_ten_companies():
assert len(COMPANIES) == 10 assert len(COMPANIES) == 50