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

Method test_get_github_primary_email

app/git/tests/test_utils.py:170–180  ·  view source on GitHub ↗

Test the github utility get_github_primary_email method.

(self)

Source from the content-addressed store, hash-verified

168
169 @responses.activate
170 def test_get_github_primary_email(self):
171 """Test the github utility get_github_primary_email method."""
172 data = [{'primary': True, 'email': 'test@gitcoin.co'}, {'email': 'test2@gitcoin.co'}]
173 url = 'https://api.github.com/user/emails'
174 responses.add(responses.GET, url, json=data, headers=HEADERS, status=200)
175 responses.add(responses.GET, url, json=data, headers=HEADERS, status=404)
176 email = get_github_primary_email(self.user_oauth_token)
177 no_email = get_github_primary_email(self.user_oauth_token)
178
179 assert email == 'test@gitcoin.co'
180 assert no_email == ''
181
182 @responses.activate
183 def test_get_github_emails(self):

Callers

nothing calls this directly

Calls 2

get_github_primary_emailFunction · 0.90
addMethod · 0.80

Tested by

no test coverage detected