readthrough / tests /test_deploy_check.py
Viney's picture
Claude Opus 5 (1M context)
feat: dark mode, market and quarter context on The Brief, faster cold start
3cd8872
Raw History Blame Contribute Delete
1.72 kB
import deploy_check
def test_parse_data_status_detects_dirty_data_paths():
porcelain = (
" M data/sections.db\n"
"M data/metrics.db\n"
"?? data/chroma/new-index.bin\n"
)
assert deploy_check.parse_data_status(porcelain) == [
"data/sections.db",
"data/metrics.db",
"data/chroma/new-index.bin",
]
def test_collect_coverage_flags_unattempted_required_sections(monkeypatch):
coverage_by_ticker = {
"AAPL": {
"status": "PARTIAL",
"business_sections": 0,
"business_sections_attempted": 0,
"segments_geography_sections": 0,
"segments_geography_sections_attempted": 0,
"recent_transcripts": 2,
},
"NVDA": {
"status": "COMPLETE",
"business_sections": 1,
"business_sections_attempted": 1,
"segments_geography_sections": 1,
"segments_geography_sections_attempted": 1,
"recent_transcripts": 4,
},
}
monkeypatch.setattr(
deploy_check,
"profile_source_coverage",
lambda ticker: coverage_by_ticker[ticker],
)
rows, incomplete = deploy_check.collect_coverage(["AAPL", "NVDA"])
assert incomplete == ["AAPL"]
assert rows == [
{
"ticker": "AAPL",
"status": "PARTIAL",
"business_sections": 0,
"segments_geography_sections": 0,
"recent_transcripts": 2,
},
{
"ticker": "NVDA",
"status": "COMPLETE",
"business_sections": 1,
"segments_geography_sections": 1,
"recent_transcripts": 4,
},
]