test: add unit tests for Strawberry adapter extension#22
Merged
nogueira-raphael merged 1 commit intomainfrom Feb 15, 2026
Merged
test: add unit tests for Strawberry adapter extension#22nogueira-raphael merged 1 commit intomainfrom
nogueira-raphael merged 1 commit intomainfrom
Conversation
Add 46 unit tests covering all methods of the CacheExtension factory and inner _CacheExtension class, bringing coverage from 13% to 100%. Tests cover: cache check logic, mutation detection, should_cache callback, on_execute/on_operation lifecycle, cache response storage, mutation auto-invalidation, tag extraction, and get_results metadata.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
==========================================
+ Coverage 71.41% 79.12% +7.70%
==========================================
Files 34 34
Lines 1025 1025
Branches 162 162
==========================================
+ Hits 732 811 +79
+ Misses 254 175 -79
Partials 39 39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CacheExtensionfactory and inner_CacheExtensionclass in the Strawberry adaptercacheql.adapters.strawberry_check_cache,_cache_response,on_operation,on_execute,_handle_mutation_invalidation,_extract_tags_from_response,get_resultsTest plan
uv run pytest tests/unit/adapters/strawberry/ -v)cacheql.adapters.strawberry