Check some information on cached requests
()
| 86 | |
| 87 | |
| 88 | def 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 | |
| 102 | def main(): |