Skip to content

geotiff: cover compress()/decompress() dispatcher error branches #2995

@brendancol

Description

@brendancol

Test-coverage sweep (deep-sweep test-coverage, geotiff).

The codec dispatchers in xrspatial/geotiff/_compression.py have error branches that no test exercises:

  • decompress(data, <unsupported_tag>) raises ValueError("Unsupported compression type: ...") (line ~1841).
  • compress(data, COMPRESSION_JPEG) raises ValueError("Use jpeg_compress() directly ...") (line ~1881).
  • compress(data, COMPRESSION_JPEG2000) raises ValueError("Use jpeg2000_compress() directly ...") (line ~1883).
  • compress(data, COMPRESSION_LERC) raises ValueError("Use lerc_compress() directly ...") (line ~1885).
  • compress(data, <unsupported_tag>) raises ValueError("Unsupported compression type: ...") (line ~1887).

These are misuse guards (Cat 4, error-path coverage). The block codecs (JPEG/JPEG2000/LERC) need width/height/samples and so are intentionally rejected by the byte-stream compress() entry point; the dispatcher else rejects unknown tags. No test pins this behavior today, so a regression that silently mis-routes or drops a guard would not be caught.

Test-only change. No source modification expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTest coverage and parity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions