Example #1
0
 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')
Example #2
0
 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')
Example #3
0
 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')
Example #4
0
 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')
Example #5
0
 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'])
Example #6
0
 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'])