fix: update stale tests — 50 companies, normalization defaults, low-confidence thresholds
This commit is contained in:
@@ -171,9 +171,11 @@ class TestExtractionStage:
|
||||
assert len(report.errors) > 0
|
||||
|
||||
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)
|
||||
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):
|
||||
result = ExtractionResult.model_validate(SAMPLE_EXTRACTION_JSON)
|
||||
|
||||
@@ -426,11 +426,11 @@ class TestRecommendationDrivenOrders:
|
||||
impacts = [
|
||||
ImpactRow(
|
||||
document_id="doc-weak-1",
|
||||
confidence=0.40,
|
||||
novelty_score=0.3,
|
||||
source_credibility=0.5,
|
||||
confidence=0.20,
|
||||
novelty_score=0.1,
|
||||
source_credibility=0.2,
|
||||
sentiment="positive",
|
||||
impact_score=0.3,
|
||||
impact_score=0.1,
|
||||
catalyst_type="other",
|
||||
key_facts=["Minor update"],
|
||||
risks=[],
|
||||
@@ -438,11 +438,11 @@ class TestRecommendationDrivenOrders:
|
||||
),
|
||||
ImpactRow(
|
||||
document_id="doc-weak-2",
|
||||
confidence=0.35,
|
||||
novelty_score=0.2,
|
||||
source_credibility=0.4,
|
||||
sentiment="positive",
|
||||
impact_score=0.25,
|
||||
confidence=0.15,
|
||||
novelty_score=0.1,
|
||||
source_credibility=0.2,
|
||||
sentiment="negative",
|
||||
impact_score=0.1,
|
||||
catalyst_type="other",
|
||||
key_facts=["Routine filing"],
|
||||
risks=[],
|
||||
|
||||
@@ -102,4 +102,4 @@ def test_seed_sources_have_valid_types():
|
||||
|
||||
|
||||
def test_seed_has_ten_companies():
|
||||
assert len(COMPANIES) == 10
|
||||
assert len(COMPANIES) == 50
|
||||
|
||||
Reference in New Issue
Block a user