MCPcopy Create free account
hub / github.com/requests-cache/requests-cache / check_cache

Function check_cache

examples/pygithub.py:88–99  ·  view source on GitHub ↗

Check some information on cached requests

()

Source from the content-addressed store, hash-verified

86
87
88def check_cache():
89 """Check some information on cached requests"""
90 # Show all the GitHub API URLs that PyGithub called
91 print('\nCached URLs:')
92 print('\n'.join(get_cache().urls()))
93
94 # Make sure credentials were redacted from all responses in the cache
95 response = requests.get('https://api.github.com/user/repos')
96 print('\nExample cached request headers:')
97 print(response.request.headers)
98 for response in get_cache().responses.values():
99 assert 'Authorization' not in response.request.headers
100
101
102def main():

Callers 1

mainFunction · 0.85

Calls 4

get_cacheFunction · 0.90
urlsMethod · 0.80
getMethod · 0.80
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…