sift_py.grpc.cache_test
¶
| CLASS | DESCRIPTION |
|---|---|
AuthInterceptor |
Simple auth interceptor that checks for Bearer token. |
DataService |
Mock data service that returns a unique response each time. |
| FUNCTION | DESCRIPTION |
|---|---|
server_with_service |
Create a test server with a spy on the DataService. |
test_basic_caching |
Test basic cache hit and miss scenarios. |
test_cache_helper_functions |
Test the cache metadata helper functions. |
test_cache_key_generation |
Test deterministic cache key generation. |
test_cache_metadata_resolution |
Test cache metadata resolution logic. |
test_cache_persists_across_channels |
Test that cache persists across different channel instances. |
test_custom_ttl |
Test custom TTL parameter. |
test_different_requests_different_cache_keys |
Test that different requests use different cache entries. |
test_force_refresh |
Test force refresh bypasses cache and updates it. |
test_grpc_cache_initialization |
Test GrpcCache initialization and configuration. |
test_ignore_cache |
Test ignore_cache bypasses cache without updating it. |
test_metadata_merging |
Test that cache metadata is properly merged with API key metadata. |
AuthInterceptor
¶
DataService
¶
server_with_service
¶
Create a test server with a spy on the DataService.
| RETURNS | DESCRIPTION |
|---|---|
|
Tuple of (spy, data_service, port) |
test_basic_caching
async
¶
Test basic cache hit and miss scenarios.
test_cache_helper_functions
¶
Test the cache metadata helper functions.
test_cache_metadata_resolution
¶
Test cache metadata resolution logic.
test_cache_persists_across_channels
async
¶
Test that cache persists across different channel instances.
test_different_requests_different_cache_keys
async
¶
Test that different requests use different cache entries.
test_force_refresh
async
¶
Test force refresh bypasses cache and updates it.
test_grpc_cache_initialization
¶
Test GrpcCache initialization and configuration.
test_ignore_cache
async
¶
Test ignore_cache bypasses cache without updating it.
test_metadata_merging
async
¶
Test that cache metadata is properly merged with API key metadata.