def test_unparseable_response(self): httpretty.register_uri( httpretty.GET, BASE_URL + 'v3/owner/foo/repos', body="""{"repositories": [{"no-name": "no"}]}""", ) with self.assertRaises(KeyError): get_repos('foo')
def test_bad_repos_response(self): httpretty.register_uri( httpretty.GET, BASE_URL + 'v3/owner/foo/repos', body=self.response_body, status=404, ) with self.assertRaises(requests.HTTPError): get_repos('foo')
def test_get_active_repos(self): httpretty.register_uri( httpretty.GET, BASE_URL + 'v3/owner/foo/repos', body=self.response_body, status=200, ) repos = get_repos('foo') self.assertListEqual(repos, ['foo', 'bar'])