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