Spaces:
Sleeping
Sleeping
Download tests/test_deploy_check.py from Viney/readthrough: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/spaces/Viney/readthrough/resolve/main/tests/test_deploy_check.py
- Command line
-
hf download hf://spaces/Viney/readthrough/tests/test_deploy_check.py
-
curl -L -o test_deploy_check.py https://huggingface.co/spaces/Viney/readthrough/resolve/main/tests/test_deploy_check.py
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, | |
| }, | |
| ] | |