MCPcopy
hub / github.com/gitcoinco/web / test_reset_token

Method test_reset_token

app/git/tests/test_utils.py:96–109  ·  view source on GitHub ↗

Test the github utility reset_token method.

(self)

Source from the content-addressed store, hash-verified

94
95 @responses.activate
96 def test_reset_token(self):
97 """Test the github utility reset_token method."""
98 auth_dict = build_auth_dict(self.user_oauth_token)
99 url = TOKEN_URL.format(**auth_dict)
100 data = {'token': self.user_oauth_token}
101 responses.add(responses.POST, url, json=data, headers=HEADERS, status=200)
102 responses.add(responses.POST, url, headers=HEADERS, status=404)
103 result = reset_token(self.user_oauth_token)
104 result_not_found = reset_token(self.user_oauth_token)
105
106 assert responses.calls[0].request.url == url
107 assert responses.calls[1].request.url == url
108 assert result == self.user_oauth_token
109 assert result_not_found == ''
110
111 @responses.activate
112 def test_get_github_user_token(self):

Callers

nothing calls this directly

Calls 3

build_auth_dictFunction · 0.90
reset_tokenFunction · 0.90
addMethod · 0.80

Tested by

no test coverage detected