Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/requests-cache/requests-cache
/ functions
Functions
788 in github.com/requests-cache/requests-cache
⨍
Functions
788
◇
Types & classes
66
↳
Endpoints
31
Function
test_save_response__manual
(mock_session)
tests/unit/test_base_cache.py:319
Function
test_send_and_cache__already_cached
If _send_and_cache() receives a cached response after re-sending an updated request, it should be returned as-is
tests/unit/test_session.py:1195
Function
test_session_is_a_class_with_original_attributes
(installed_session)
tests/unit/test_patcher.py:41
Function
test_session_settings
()
tests/unit/test_patcher.py:22
Function
test_set_request_headers
()
tests/unit/policy/test_expiration.py:112
Function
test_set_request_headers__do_not_cache
()
tests/unit/policy/test_expiration.py:124
Function
test_size
(mock_session)
tests/unit/models/test_response.py:135
Method
test_size
Check that size updates with bytes added/updated/removed.
tests/integration/test_filesystem.py:69
Method
test_size
Check that size updates with bytes added/updated/removed.
tests/integration/test_filesystem.py:238
Method
test_size
Check that the total bytes are summed up if files are added.
tests/integration/test_filesystem.py:557
Method
test_size
Test approximate expected size of a database, for both file-based and in-memory databases
tests/integration/test_sqlite.py:322
Method
test_sorted
(self, sort_key, reversed_order, limit, expected)
tests/integration/test_filesystem.py:420
Method
test_sorted
Test wrapper method for SQLiteDict.sorted(), with all arguments combined
tests/integration/test_sqlite.py:431
Method
test_sorted__by_expires
(self, limit)
tests/integration/test_sqlite.py:250
Method
test_sorted__by_size
(self, limit)
tests/integration/test_sqlite.py:213
Method
test_sorted__error
sorted() should handle deserialization errors and not return invalid responses
tests/integration/test_sqlite.py:291
Method
test_sorted__exclude_expired
(self)
tests/integration/test_sqlite.py:268
Method
test_sorted__invalid_key
(self)
tests/integration/test_filesystem.py:433
Method
test_sorted__invalid_sort_key
(self)
tests/integration/test_sqlite.py:242
Method
test_sorted__reversed
(self)
tests/integration/test_sqlite.py:230
Function
test_stale_if_error__error_code
With stale_if_error, expect to get old cache data if a response has an error status code, that is not in allowable_codes.
tests/unit/test_session.py:528
Function
test_stale_if_error__error_code_in_allowable_codes
With stale_if_error, expect to get the failed response if a response has an error status code, that is in allowable_codes.
tests/unit/test_session.py:549
Function
test_stale_if_error__exception
With stale_if_error, expect to get old cache data if there is an exception during a request
tests/unit/test_session.py:512
Function
test_stale_if_error__max_stale
With stale_if_error as a time value, expect to get old cache data if a response has an error status code AND it is expired by less than the specif
tests/unit/test_session.py:569
Function
test_stale_while_revalidate
(mock_session)
tests/unit/test_session.py:868
Function
test_stale_while_revalidate__refresh
stale_while_revalidate should also apply to normal refresh requests
tests/unit/test_session.py:919
Function
test_stale_while_revalidate__time
stale_while_revalidate should also accept a time value (max acceptable staleness)
tests/unit/test_session.py:903
Function
test_str
Just ensure that a subset of relevant attrs get included in the response str; the format may change without breaking the test.
tests/unit/models/test_response.py:143
Method
test_str
Not much to test for __str__ methods, just make sure they return keys in some format
tests/integration/base_storage_test.py:172
Function
test_stream
()
tests/unit/models/test_raw_response.py:53
Method
test_sync_index
With sync_index=True, the LRU index should be updated on init for any manual file changes.
tests/integration/test_filesystem.py:214
Method
test_total_size
Test that total cache size is tracked correctly
tests/integration/test_filesystem.py:440
Method
test_ttl
(self)
tests/integration/test_mongodb.py:59
Method
test_ttl
DynamoDB's TTL removal process can take up to 48 hours to run, so just test if the 'ttl' attribute is set correctly if enabled, and not set if
tests/integration/test_dynamodb.py:75
Method
test_ttl
(self, mock_setex)
tests/integration/test_redis.py:47
Method
test_ttl__disabled
(self, mock_set, mock_setex)
tests/integration/test_redis.py:62
Method
test_ttl__no_expiry
Items with no expiry should use SET (no TTL) even when ttl_offset is configured
tests/integration/test_redis.py:70
Method
test_ttl__offset
(self, mock_setex)
tests/integration/test_redis.py:54
Method
test_ttl__overwrite
(self)
tests/integration/test_mongodb.py:77
Function
test_unpickle_errors
If there is an error during deserialization, the request should be made again
tests/unit/test_session.py:611
Function
test_update
(mock_session)
tests/unit/test_base_cache.py:325
Method
test_update_access_time
(self)
tests/integration/test_filesystem.py:459
Method
test_update_access_time__keyerror
(self)
tests/integration/test_filesystem.py:470
Function
test_update_from_cached_response__504
()
tests/unit/policy/test_actions.py:227
Function
test_update_from_cached_response__force_revalidate
Conditional request headers should be added if requested by response headers, even if the response is not expired
tests/unit/policy/test_actions.py:193
Function
test_update_from_cached_response__new_request
()
tests/unit/policy/test_actions.py:149
Function
test_update_from_cached_response__no_revalidation
Conditional request headers should NOT be added if the cached response is not expired and revalidation is otherwise not requested
tests/unit/policy/test_actions.py:215
Function
test_update_from_cached_response__resend_request
()
tests/unit/policy/test_actions.py:155
Function
test_update_from_cached_response__revalidate
Conditional request headers should be added if the cached response is expired
tests/unit/policy/test_actions.py:174
Function
test_update_from_cached_response__stale_if_error
()
tests/unit/policy/test_actions.py:234
Function
test_update_from_cached_response__stale_while_revalidate
()
tests/unit/policy/test_actions.py:241
Function
test_update_from_cached_response__vary_cookie
(cached_cookies, new_cookies, expected_match)
tests/unit/policy/test_actions.py:428
Function
test_update_from_cached_response__vary_cookie_and_headers
()
tests/unit/policy/test_actions.py:456
Function
test_update_from_cached_response__vary_headers
( vary, cached_headers, new_headers, expected_match )
tests/unit/policy/test_actions.py:314
Function
test_update_from_response
Test with Cache-Control response headers
tests/unit/policy/test_actions.py:576
Function
test_update_from_response__ignored
()
tests/unit/policy/test_actions.py:591
Function
test_update_from_response__no_store
()
tests/unit/policy/test_actions.py:585
Function
test_update_from_response__revalidate
If expiration is 0 and there's a validator, the response should be cached, but with immediate expiration
tests/unit/policy/test_actions.py:600
Function
test_update_revalidated_response__skip_write
skip_write should be True when read_only=True or when nothing changed, and False when headers/expiration changed and read_only=False
tests/unit/policy/test_actions.py:621
Function
test_update_revalidated_response__transfer_encoding
When updating response headers after revalidating a cached response, don't set both `Content-Length` and `Transfer-Encoding`
tests/unit/policy/test_actions.py:636
Function
test_url_allowlist
If the default is 0, only URLs matching patterns in urls_expire_after should be cached
tests/unit/test_session.py:840
Function
test_urls
(mock_normalize_url, mock_session)
tests/unit/test_base_cache.py:337
Function
test_urls__error
(mock_session)
tests/unit/test_base_cache.py:345
Method
test_use_cache_dir
(self)
tests/integration/test_filesystem.py:52
Method
test_use_cache_dir
(self)
tests/integration/test_sqlite.py:45
Method
test_use_memory
(self)
tests/integration/test_sqlite.py:57
Method
test_use_memory__uri
(self)
tests/integration/test_sqlite.py:72
Method
test_use_temp
(self)
tests/integration/test_filesystem.py:58
Method
test_use_temp
(self)
tests/integration/test_sqlite.py:51
Method
test_vacuum__commits_active_transaction
(self)
tests/integration/test_sqlite.py:199
Method
test_vacuum__frees_disk_space
vacuum() should reclaim disk space after bulk deletion (regression test for #1156)
tests/integration/test_sqlite.py:398
Method
test_vacuum__no_connection
(self)
tests/integration/test_sqlite.py:194
Method
test_values_are_replaced
Check that keys are added.
tests/integration/base_storage_test.py:213
Function
test_vary_cache_key
(vary, cached_headers, new_headers, expect_vary_key_set)
tests/unit/policy/test_actions.py:344
Function
test_vary_cache_key__match_all
vary_cache_key should be set when match_headers=True (match all headers)
tests/unit/policy/test_actions.py:392
Function
test_vary_cache_key__merges_user_match_headers
vary_cache_key should incorporate user match_headers along with Vary headers
tests/unit/policy/test_actions.py:360
Function
test_verify
(mock_session)
tests/unit/test_session.py:221
Function
test_version_upgrade
Load SQLite cache files created with older versions of requests-cache. Expected behavior: either 1. Serialization format is incompatible, and
tests/integration/test_upgrade.py:10
Method
test_wal_sync_mode
(self)
tests/integration/test_sqlite.py:152
Function
test_wrap
()
tests/unit/test_session.py:86
Method
test_write__error
Errors from write operations should propagate
tests/integration/test_sqlite.py:184
Method
test_write_acquire_lock
Writes to the database acquire the sqlite lock
tests/integration/test_sqlite.py:165
Method
test_write_retry_acquire_lock
Acquiring the lock should retry BEGIN IMMEDIATE until it succeeds
tests/integration/test_sqlite.py:172
Function
to_vcr_cassettes_by_host
Export cached responses as VCR-compatible YAML files (cassettes), split into separate files based on request host Args: cache: Cache
examples/vcr.py:31
Method
total_requests
(self)
examples/rps_graph.py:89
Method
values
Get all values in the hash
requests_cache/backends/redis.py:196
Method
values
(self)
requests_cache/backends/dynamodb.py:183
Function
wrapper
(*args, **kwargs)
tests/conftest.py:304
← previous
701–788 of 788, ranked by callers