fix(ofsted): a gov.uk outage skips the FE streams, not the Ofsted extract (review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c16dd0044f
commit
32715af568
3 files changed
+88
-23
No files matched your search
@@ -136,3 +136,30 @@ def test_csv_reading_and_records(fe):
|
||||
'provider_type': 'Sixth form college', 'renewed_eif_full_inspection': 'No',
|
||||
'graded_inspection_date': '06/12/2022', 'overall_effectiveness': '2', 'short_inspection_date': '-',
|
||||
}]
|
||||
|
||||
|
||||
def test_a_gov_uk_outage_yields_no_providers_rather_than_failing(fe):
|
||||
# The FE streams share the monthly Ofsted extract with the school MI; an
|
||||
# error here must not fail that extract (review of H4).
|
||||
def down():
|
||||
raise ConnectionError('gov.uk unreachable')
|
||||
logged = []
|
||||
assert list(fe.provider_records(down, lambda page: '', lambda url: b'', logged.append)) == []
|
||||
assert logged
|
||||
|
||||
|
||||
def test_one_unreachable_page_does_not_stop_the_other_report_cards(fe):
|
||||
results = [{'title': fe.PAGE_TITLE_PREFIX + 'September 2026 to August 2027', 'link': '/fe-2026-27'},
|
||||
{'title': fe.PAGE_TITLE_PREFIX + 'November 2025 to August 2026', 'link': '/fe-2025-26'}]
|
||||
csv = (','.join(INSPECTION_HEADER[:12]) + '\n'
|
||||
+ '143526,10028480,The Autism Project,,,,,,10427540,12/05/2026,22/07/2026,Met\n').encode()
|
||||
|
||||
def page(path):
|
||||
if path == '/fe-2026-27':
|
||||
raise ConnectionError('timeout')
|
||||
return PAGE_2025_26
|
||||
|
||||
logged = []
|
||||
rows = list(fe.inspection_records(lambda: results, page, lambda url: csv, logged.append))
|
||||
assert [r['inspection_number'] for r in rows] == ['10427540']
|
||||
assert logged
|
||||
Reference in new issue
Block a user