This doesn't yet mock the response from GitHub, it makes a live call
This call could be ratelimited or fail due to transient network issues
Once we switch to using requests we'll want to mock out this GitHub
response
This commit is contained in:
Gene Wood 2019-10-07 16:42:25 -07:00
Родитель f745fa244f
Коммит 9bfcbd8aa7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F0A9E7DCD39E452E
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -88,5 +88,17 @@ class TestIncompleteRequest(unittest.TestCase):
)
def test_github():
g = GitHub()
status, data = g.users.octocat.get()
assert data.get('name') == 'The Octocat'
assert status == 200
# Workaround to https://github.com/mozilla/agithub/issues/67
response_headers = dict([(x.lower(), y) for x, y in g.getheaders()])
assert (
response_headers.get('Content-Type'.lower()) ==
'application/json; charset=utf-8')
if __name__ == '__main__':
unittest.main()