Skip to content

test: cover SimpleCache and AuthHandler serialization - #187

Merged
beaufour merged 1 commit into
masterfrom
test/raise-coverage-auth-cache
Oct 27, 2026
Merged

beaufour merged 1 commit into
masterfrom
test/raise-coverage-auth-cache

Conversation

@beaufour

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #183, which showed cache.py at 40% and auth.py at 65% coverage. Adds tests for the untested pure-logic paths, all network interactions mocked:

  • cache.py 40% → 100%: set/get/default, expiry purge, delete (incl. silent missing key), has_key/__contains__, culling (incl. auto-cull when full), and the reentrant @locking behavior.
  • auth.py 65% → 91%: tofile/save/write/load/fromfile roundtrips (with and without API keys), todict/fromdict (access + request tokens), token_factory, guard errors (AuthHandlerError/ValueError), the request-token fetch path (requests.post mocked), and OAuthRequest's dict-like interface incl. complete_parameters.

Local: 323 tests pass (was 291), branch coverage 80% → 84%.

Test Plan

  • uv run pytest --cov=flickr_api locally
  • CI green

Automated prep by Hermes maintainer.

- cache.py: 40% -> 100% (set/get, expiry, delete, cull, locking)
- auth.py: 65% -> 91% (file/dict serialization roundtrips, token_factory,
  guard errors, OAuthRequest dict-like interface, request-token fetch path)
- All network interactions are mocked; no live Flickr calls
@beaufour
beaufour force-pushed the test/raise-coverage-auth-cache branch from 7a8e685 to 8fa3fcf Compare October 27, 2026 12:53
@beaufour
beaufour merged commit 6f222b4 into master Oct 27, 2026
6 checks passed
@beaufour
beaufour deleted the test/raise-coverage-auth-cache branch October 27, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant