From the round-1 review of #212 .
Where: tests/test_fleet_page.py CardCheckTests.
Mutation testing in a scratch copy found four changes that all 59 tests survive:
read_source() filing a published() exception (for example a JSON decode failure) as unread instead of CHANGED. No test uses a json-kind source, so an HTML shell served at ingredients.json with status 200 would go back to the check_cards.py passes when a source returns 404 or its wording changes, against its own docstring #176 failure unnoticed.
unread * 2 > len(SOURCES) changed to >=. With three fake sources, "more than half" can't be told apart from "at least half".
region() returning the text after BEGIN when END is missing.
main() failing on an unread row.
Fix: add tests for each of the four:
a json source whose body is HTML, expected CHANGED;
ten sources, where five unread passes and six fails;
BEGIN present with END missing, expected CHANGED;
main() returning 0 when one row is unread.
From the round-1 review of #212.
Where:
tests/test_fleet_page.pyCardCheckTests.Mutation testing in a scratch copy found four changes that all 59 tests survive:
read_source()filing apublished()exception (for example a JSON decode failure) as unread instead of CHANGED. No test uses a json-kind source, so an HTML shell served atingredients.jsonwith status 200 would go back to the check_cards.py passes when a source returns 404 or its wording changes, against its own docstring #176 failure unnoticed.unread * 2 > len(SOURCES)changed to>=. With three fake sources, "more than half" can't be told apart from "at least half".region()returning the text after BEGIN when END is missing.main()failing on an unread row.Fix: add tests for each of the four:
main()returning 0 when one row is unread.