Test the github utility get_github_primary_email method.
(self)
| 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): |
nothing calls this directly
no test coverage detected