Skip to content

Address Test Coverage Gaps #31

Description

@mwaddell

Missing Edge-Case Tests

This checklist records edge cases identified during the unit-test coverage
review. Each item should be marked complete only after a focused unit test is
added and passing.

Command-Line Configuration

  • Verify main() rejects --api google when no API key is supplied by
    --apiKey, the environment, or .env.
  • Verify main() rejects --api geocodio when no API key is supplied by
    --apiKey, the environment, or .env.
  • Verify main() accepts a CLI API key for a keyed provider.
  • Verify main() accepts an API key supplied through the environment.
  • Verify main() accepts an API key loaded from .env.
  • Verify .env parsing accepts trimmed and quoted KEY=value values.
  • Verify .env parsing ignores blank lines, comments, and malformed lines.
  • Verify existing environment variables take precedence over .env values.

Relevant code: src/geocoder.py:69-89, src/geocoder.py:397-401.

Workbook Input

  • Verify a None header cell is ignored while recognized header cells are
    still detected.
  • Verify fully blank input rows are skipped and do not create output rows.
  • Verify blank rows do not disrupt sequential record IDs or provider-result
    alignment.
  • Verify a short row with missing optional cells is treated as having blank
    values rather than raising an indexing error.
  • Verify a valid header-only worksheet produces an output sheet with headers
    and no data rows without making provider requests.
  • Verify an empty worksheet is skipped when another worksheet is valid.
  • Verify a workbook containing only empty worksheets exits without creating
    an output file.

Relevant code: src/geocoder.py:100-167, src/geocoder.py:280-302.

Shared Provider Behavior

  • Verify the expected behavior when a provider fetch yields fewer responses
    than requested records. Decide whether missing responses should become
    no-matches or raise a descriptive error.
  • Verify an empty input record list does not make provider requests and
    returns an empty result list.

Relevant code: src/api.py:256-292.

Census Provider

  • Verify a Census response row with an unknown internal ID is rejected or
    handled according to an explicitly documented policy.
  • Verify malformed Census row IDs, including blank and non-numeric values,
    produce a descriptive error.
  • Verify undersized non-match and tie rows are handled or rejected with a
    descriptive error.
  • Verify records are split at BATCH_SIZE boundaries and all batches retain
    input-result ordering.

Relevant code: src/census.py:79-110.

Google Provider

  • Verify a Google OK response with a missing or empty results list is
    handled without an unhelpful KeyError or IndexError.
  • Verify a Google result with missing geometry or location fields has
    defined coordinate behavior.
  • Verify malformed address_components entries produce a descriptive error
    or are safely ignored according to an explicit policy.

Relevant code: src/google.py:84-100, src/google.py:120-175.

Geocodio Provider

  • Verify an entry missing response or response.results is handled
    without an unhelpful KeyError or AttributeError.
  • Verify a malformed first Geocodio candidate, such as one missing
    location or address_components, has defined behavior.
  • Verify records are split at BATCH_SIZE boundaries and all batches retain
    input-result ordering.

Relevant code: src/geocodio.py:60-98, src/geocodio.py:118-162.

Legacy Launcher

  • Add a subprocess smoke test for the root geocoder.py launcher if it is
    intentionally supported alongside the installed geocoder command.
  • Remove the root launcher instead if the installed console entry point is
    the only supported interface.

Relevant code: geocoder.py:8-11.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions