MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / test_url_caching

Function test_url_caching

tests/test_cache.py:217–231  ·  view source on GitHub ↗
(mock_cache)

Source from the content-addressed store, hash-verified

215
216@responses.activate
217def test_url_caching(mock_cache):
218 payload = "Hello body"
219 url = "https://url_cache_test.example.com"
220
221 responses.add(responses.GET, url, body=payload, status=200)
222
223 response = cache.URLCache.proxy(url=url)
224 assert response == payload
225
226 cache_items = tuple(cache.CacheItem.iter_items())
227 assert len(cache_items) == 1
228 assert cache_items[0].metadata["url"] == url
229
230 cache.CacheItem.cleanup()
231 assert len(tuple(cache.CacheItem.iter_items())) == 0
232
233
234@responses.activate

Callers

nothing calls this directly

Calls 3

iter_itemsMethod · 0.80
proxyMethod · 0.45
cleanupMethod · 0.45

Tested by

no test coverage detected