summaryrefslogtreecommitdiff
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Redact ingored_parameters from CachedResponse.urlJordan Cook2021-09-152-6/+24
|
* Alias/rename old_data_on_error to stale_if_error for consistency with ↵Jordan Cook2021-09-061-8/+14
| | | | Cache-Control: stale-if-error (backwards-compatibile)
* Use blake2 instead of sha256 for hashing request infoJordan Cook2021-09-062-3/+4
| | | | | | | | | With an 8-byte digest for shorter cache keys. This is still plenty long enough to avoid hash collisions: `4e-15` for 100,000 items, `4e-7` chance for 1 billion items, etc. This makes it more convenient for manually inspecting cache items, especially for the filesystem backend, which uses cache keys as filenames.
* Allow match_headers to optionally accept a list of specific headers to matchJordan Cook2021-09-062-3/+3
|
* Alias/rename 'include_get_headers' to 'match_headers' for clarity ↵Jordan Cook2021-09-061-6/+12
| | | | (backwards-compatibile)
* Allow has_url(), delete_url(), and create_key() to optionally take ↵Jordan Cook2021-08-281-2/+20
| | | | requests.Request arguments
* Add some additional tests for cache key normalizationJordan Cook2021-08-281-2/+39
|
* Enable conditional requests by defaultJordan Cook2021-08-261-14/+6
|
* Minor optimization: exclude redundant CachedResponse.cache_key and ↵Jordan Cook2021-08-251-2/+1
| | | | CachedHTTPResponse.headers from serialization, and set at runtime instead
* Add BaseCache.update() method as a shortcut for exporting to a different ↵Jordan Cook2021-08-251-0/+11
| | | | cache instance
* Rename DbDict to SQLiteDict for consistency with other backends (with ↵Jordan Cook2021-08-192-10/+10
| | | | aliases for backwards-compatibility)
* s/whitelist/allowlistJordan Cook2021-08-191-1/+1
|
* Add support for custom cache keysJordan Cook2021-08-142-2/+13
|
* Add unit tests for new header supportJordan Cook2021-08-142-3/+75
|
* Add support for Last-Modified + If-Modified-Since headersJordan Cook2021-08-141-5/+0
|
* Convert CacheActions into an attrs classJordan Cook2021-08-141-7/+17
|
* Remove deprecated 'core' module and BaseCache.remove_old_entries()Jordan Cook2021-08-142-21/+5
|
* Drop support for python 3.6Jordan Cook2021-08-141-4/+0
|
* Parallelize unit tests per module instead of per functionJordan Cook2021-08-121-11/+13
|
* Add more test coverage for cache_control and cache_keys modulesJordan Cook2021-08-122-2/+41
|
* Add test coverage for optional serialization dependenciesJordan Cook2021-08-122-33/+52
|
* Apply whitespace/EOF fixes and isort updatesJordan Cook2021-08-084-4/+5
|
* Add a `BaseCache.delete_urls()` methodJordan Cook2021-08-021-3/+13
|
* Update `DbCache.clear()` to succeed even if the database is corruptedJordan Cook2021-08-021-3/+3
|
* Add CachedResponse.cache_key attribute and update in CachedSession.send()Jordan Cook2021-07-203-8/+11
|
* Fix cache_control option to correctly toggle cache header usage (off by default)Jordan Cook2021-07-091-1/+8
|
* Some serialization fixes & updates:Jordan Cook2021-07-032-7/+10
| | | | | | | | | | | | | | | | | * Fix tests on python 3.6: * Make `cattrs` optional again * Don't run tests for serializers with missing optional dependencies * Show any skipped tests in pytest output * Fix redirect serialization for backends that serialize all values (DynamoDB and Redis) * Otherwise, the redirect value (which is just another key) will get converted into a `CachedResponse` * Make `pickle` serializer use `cattrs` if installed * Make `bson` serializer compatible with both `pymongo` version and standalone `bson` library * Split up `CattrStage` and preconf converters into separate modules * Turn preconf converters into `Stage` objects * Add `DeprecationWarning` for previous method of using `itsdangerous`, now that there's a better way to initialize it via `SerializerPipeline` * Remove `suppress_warnings` kwarg that's now unused * Make `SerializerPipeline`, `Stage`, and `CattrStage` importable from top-level package (`from requests_cache import ...`) * Add some more details to docs and docstrings
* Add option to exclude expired responses in keys(), values(), and ↵Jordan Cook2021-07-031-6/+15
| | | | response_count()
* Rephrase BaseCache.__str__() count as 'total rows' to be less ambiguous, ↵Jordan Cook2021-07-031-1/+1
| | | | since the total may include invalid responses
* Add BaseCache.response_count() method to get an accurate count of valid ↵Jordan Cook2021-07-031-0/+19
| | | | responses
* Merge pull request #286 from parkerhancock/serialization_pipelinesJordan Cook2021-06-222-9/+10
|\ | | | | Serialization Pipeline Refactor
| * initial serialization pipeline refactorParker Hancock2021-06-142-9/+10
| |
* | Add ImportError to list of possible deserialization errors to catchJordan Cook2021-06-201-5/+2
|/ | | | See issue #296
* Workaround for poetry issue on python 3.10 betaJordan Cook2021-06-111-3/+1
|
* Add tests and docsJordan Cook2021-06-112-6/+45
|
* Merge 0.6.4 hotfix into masterJordan Cook2021-06-041-2/+2
|
* Compatibility fixes for requests 2.16 and 2.17Jordan Cook2021-06-031-1/+2
|
* Fix broken unit tests and add more coverageJordan Cook2021-05-264-63/+108
|
* Add support for using request and response cache headers to set cache expirationJordan Cook2021-05-073-63/+237
|
* Add support for bypassing the cache if expire_after=0Jordan Cook2021-04-293-5/+40
| | | | | * Bump up wait time for `test_remove_expired_responses__per_request()`, since that seems to be failing intermittently
* Make sure all tests with SQLite dbs clean up after themselvesJordan Cook2021-04-292-51/+43
|
* Improve performance a bit for remove_expired_responses()Jordan Cook2021-04-291-2/+2
|
* Add response details to CachedResponse str() and repr()Jordan Cook2021-04-291-0/+41
|
* Add BaseCache.keys() and values() methodsJordan Cook2021-04-271-2/+33
| | | | | * Update `BaseCache.urls` to return a generator instead of the whole list at once (which may use too much memory for particularly large caches) * Update `BaseCache.urls` to just skip invalid responses instead of deleting them
* Include this behavior in old_data_on_error instead, to avoid complicationsJordan Cook2021-04-231-19/+4
|
* Add raise_for_status optionJordan Cook2021-04-231-0/+29
|
* Run multi-threaded tests for all backends, and run with more threads & ↵Jordan Cook2021-04-201-26/+0
| | | | iterations for merges to master
* Add option to manually cache response objectsJordan Cook2021-04-191-0/+6
| | | | Updates #98
* Don't show warnings for 'include_get_headers' and 'ignored_parameters' ↵Jordan Cook2021-04-181-5/+5
| | | | | | | kwargs in BaseStorage Also don't name them as private members, since they can safely by changed after initialization (e.g., `session.cache.include_get_headers = True`)
* Read manually instead of using _body, move decode tests to integration testsshiftinv2021-04-181-21/+1
|