def test_request(fx_github_access_token, fx_github_identity): result = request( fx_github_access_token, 'https://api.github.com/user', 'GET' ) assert result['type'] == 'User' result2 = request( fx_github_identity, 'https://api.github.com/user', 'GET' ) assert result == result2
def fx_github_identity(fx_github_access_token): global _fx_github_identity_cache if not _fx_github_identity_cache: _fx_github_identity_cache = request(fx_github_access_token, 'https://api.github.com/user', 'GET') return Identity(GitHubOrganization, _fx_github_identity_cache['login'], fx_github_access_token)
def fx_github_identity(fx_github_access_token): global _fx_github_identity_cache if not _fx_github_identity_cache: _fx_github_identity_cache = request( fx_github_access_token, 'https://api.github.com/user', 'GET' ) return Identity( GitHubOrganization, _fx_github_identity_cache['login'], fx_github_access_token )
def cleanup_ssh_keys(identity): keys = request(identity, GitHubKeyStore.LIST_URL, 'GET') for key in keys: url = GitHubKeyStore.DEREGISTER_URL.format(**key) request(identity, url, 'DELETE')
def test_request(fx_github_access_token, fx_github_identity): result = request(fx_github_access_token, 'https://api.github.com/user', 'GET') assert result['type'] == 'User' result2 = request(fx_github_identity, 'https://api.github.com/user', 'GET') assert result == result2