fix: update test — empty ticker now filtered out instead of failing extraction
This commit is contained in:
@@ -215,12 +215,14 @@ def test_all_company_fields_required():
|
|||||||
|
|
||||||
|
|
||||||
def test_validate_semantic_missing_ticker_is_error():
|
def test_validate_semantic_missing_ticker_is_error():
|
||||||
"""A company with an empty ticker produces a semantic error, not just a warning."""
|
"""A company with an empty ticker is filtered out during normalization."""
|
||||||
data = _valid_extraction()
|
data = _valid_extraction()
|
||||||
data["companies"][0]["ticker"] = ""
|
data["companies"][0]["ticker"] = ""
|
||||||
report = validate_extraction(data)
|
report = validate_extraction(data)
|
||||||
assert not report.valid
|
# Empty-ticker companies are now filtered out (not a fatal error)
|
||||||
assert any("company_missing_ticker" in e for e in report.errors)
|
assert report.valid
|
||||||
|
assert report.parsed is not None
|
||||||
|
assert len(report.parsed.companies) == 0
|
||||||
|
|
||||||
|
|
||||||
def test_validate_semantic_invalid_impact_horizon_is_error():
|
def test_validate_semantic_invalid_impact_horizon_is_error():
|
||||||
|
|||||||
Reference in New Issue
Block a user