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

Method test_get_github_emails

app/git/tests/test_utils.py:183–195  ·  view source on GitHub ↗

Test the github utility get_github_emails method.

(self)

Source from the content-addressed store, hash-verified

181
182 @responses.activate
183 def test_get_github_emails(self):
184 """Test the github utility get_github_emails method."""
185 headers = dict({'Authorization': f'token {self.user_oauth_token}'}, **JSON_HEADER)
186 data = [{'email': 'test@gitcoin.co'}, {'email': 'test2@gitcoin.co'}, {'email': 'testing@noreply.github.com'}]
187 url = 'https://api.github.com/user/emails'
188 responses.add(responses.GET, url, json=data, headers=headers, status=200)
189 responses.add(responses.GET, url, json=data, headers=headers, status=404)
190 emails = get_github_emails(self.user_oauth_token)
191 no_emails = get_github_emails(self.user_oauth_token)
192
193 assert responses.calls[0].request.url == url
194 assert emails == ['test@gitcoin.co', 'test2@gitcoin.co']
195 assert no_emails == []
196
197 @responses.activate
198 def test_get_issue_comments(self):

Callers

nothing calls this directly

Calls 2

get_github_emailsFunction · 0.90
addMethod · 0.80

Tested by

no test coverage detected