Skip to content

check_cards tests miss the parse-exception path, the more-than-half boundary and a half-marked region #222

Description

@realmarcin

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:

  1. 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.
  2. unread * 2 > len(SOURCES) changed to >=. With three fake sources, "more than half" can't be told apart from "at least half".
  3. region() returning the text after BEGIN when END is missing.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions