Add pagination to the repository list API to make it better for public

Fixes #1166
This commit is contained in:
Joseph Schorr 2016-02-01 13:06:13 +02:00
parent 4905f55268
commit 534ec9cb2b
5 changed files with 69 additions and 98 deletions

View file

@ -1360,11 +1360,6 @@ class TestListRepos(ApiTestCase):
for repo in json['repositories']:
self.assertEquals(ORGANIZATION, repo['namespace'])
def test_listrepos_limit(self):
self.login(READ_ACCESS_USER)
json = self.getJsonResponse(RepositoryList, params=dict(limit=1, public=True))
self.assertEquals(len(json['repositories']), 1)
def test_listrepos_allparams(self):
self.login(ADMIN_ACCESS_USER)
@ -1382,12 +1377,11 @@ class TestListRepos(ApiTestCase):
self.assertEquals(ORGANIZATION, repo['namespace'])
def test_listrepos_starred_nouser(self):
json = self.getJsonResponse(RepositoryList,
params=dict(last_modified=True,
popularity=True,
starred=True))
self.assertEquals(len(json['repositories']), 0)
self.getResponse(RepositoryList,
params=dict(last_modified=True,
popularity=True,
starred=True),
expected_code=400)
def test_listrepos_starred(self):
self.login(ADMIN_ACCESS_USER)