Fix the tests and the one bug that it highlighted.
This commit is contained in:
parent
b619356907
commit
e7064f1191
6 changed files with 53 additions and 24 deletions
|
@ -661,7 +661,7 @@ class TestCreateRepo(ApiTestCase):
|
|||
class TestFindRepos(ApiTestCase):
|
||||
def test_findrepos_asguest(self):
|
||||
json = self.getJsonResponse('api.find_repos', params=dict(query='p'))
|
||||
assert len(json['repositories']) == 1
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
self.assertEquals(json['repositories'][0]['namespace'], 'public')
|
||||
self.assertEquals(json['repositories'][0]['name'], 'publicrepo')
|
||||
|
@ -670,7 +670,7 @@ class TestFindRepos(ApiTestCase):
|
|||
self.login(NO_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse('api.find_repos', params=dict(query='p'))
|
||||
assert len(json['repositories']) == 1
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
self.assertEquals(json['repositories'][0]['namespace'], 'public')
|
||||
self.assertEquals(json['repositories'][0]['name'], 'publicrepo')
|
||||
|
@ -679,18 +679,18 @@ class TestFindRepos(ApiTestCase):
|
|||
self.login(READ_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse('api.find_repos', params=dict(query='p'))
|
||||
assert len(json['repositories']) > 1
|
||||
self.assertGreater(len(json['repositories']), 1)
|
||||
|
||||
|
||||
class TestListRepos(ApiTestCase):
|
||||
def test_listrepos_asguest(self):
|
||||
json = self.getJsonResponse('api.list_repos', params=dict(public=True))
|
||||
assert len(json['repositories']) == 0
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
def test_listrepos_orgmember(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
json = self.getJsonResponse('api.list_repos', params=dict(public=True))
|
||||
assert len(json['repositories']) > 1
|
||||
self.assertGreater(len(json['repositories']), 1)
|
||||
|
||||
def test_listrepos_filter(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
|
@ -705,7 +705,7 @@ class TestListRepos(ApiTestCase):
|
|||
self.login(READ_ACCESS_USER)
|
||||
json = self.getJsonResponse('api.list_repos', params=dict(limit=2))
|
||||
|
||||
assert len(json['repositories']) == 2
|
||||
self.assertEquals(len(json['repositories']), 2)
|
||||
|
||||
|
||||
class TestUpdateRepo(ApiTestCase):
|
||||
|
|
Reference in a new issue