def test_request(fx_bitbucket_access_token: str, fx_bitbucket_identity: Identity): result = request(fx_bitbucket_access_token, 'https://api.bitbucket.org/2.0/user', 'GET') assert result['type'] == 'user' result2 = request(fx_bitbucket_identity, 'https://api.bitbucket.org/2.0/user', 'GET') assert result == result2
def test_request(fx_github_access_token: str, fx_github_identity: 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: str) -> Identity: resp = request( fx_github_access_token, 'https://api.github.com/user', 'GET' ) return Identity(GitHubOrganization, resp['login'], fx_github_access_token)
def cleanup_ssh_keys(identity: 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: str, fx_github_identity: 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: str) -> Identity: resp = request(fx_github_access_token, 'https://api.github.com/user', 'GET') return Identity(GitHubOrganization, resp['login'], fx_github_access_token)
def fx_bitbucket_identity(fx_bitbucket_access_token: str) -> Identity: resp = request(fx_bitbucket_access_token, 'https://api.bitbucket.org/2.0/user', 'GET') return Identity(BitbucketTeam, resp['username'], fx_bitbucket_access_token)