MCPcopy Create free account
hub / github.com/06chaynes/http-cache / create_cache_manager

Function create_cache_manager

http-cache-reqwest/src/test.rs:15–22  ·  view source on GitHub ↗

Helper function to create a temporary cache manager

()

Source from the content-addressed store, hash-verified

13
14/// Helper function to create a temporary cache manager
15fn create_cache_manager() -> CACacheManager {
16 let cache_dir = tempfile::tempdir().expect("Failed to create temp dir");
17 // Keep the temp dir alive by leaking it - it will be cleaned up when the process exits
18 // This is acceptable for tests as they are short-lived
19 let path = cache_dir.path().to_path_buf();
20 std::mem::forget(cache_dir);
21 CACacheManager::new(path, true)
22}
23
24pub(crate) fn build_mock(
25 cache_control_val: &str,

Callers 15

default_modeFunction · 0.85
no_cache_modeFunction · 0.85
reload_modeFunction · 0.85
custom_cache_keyFunction · 0.85
custom_cache_mode_fnFunction · 0.85
override_cache_modeFunction · 0.85
no_status_headersFunction · 0.85
cache_bustFunction · 0.85
removes_warningFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected