Merge pull request #598 from coreos-inc/limitbadquery
Prevent unlimited insane query from running and fix tests
This commit is contained in:
commit
3e7a95407b
4 changed files with 15 additions and 8 deletions
|
@ -378,16 +378,16 @@ class TestRepositoryList(ApiTestCase):
|
|||
self._set_url(RepositoryList)
|
||||
|
||||
def test_get_anonymous(self):
|
||||
self._run_test('GET', 200, None, None)
|
||||
self._run_test('GET', 400, None, None)
|
||||
|
||||
def test_get_freshuser(self):
|
||||
self._run_test('GET', 200, 'freshuser', None)
|
||||
self._run_test('GET', 400, 'freshuser', None)
|
||||
|
||||
def test_get_reader(self):
|
||||
self._run_test('GET', 200, 'reader', None)
|
||||
self._run_test('GET', 400, 'reader', None)
|
||||
|
||||
def test_get_devtable(self):
|
||||
self._run_test('GET', 200, 'devtable', None)
|
||||
self._run_test('GET', 400, 'devtable', None)
|
||||
|
||||
def test_post_anonymous(self):
|
||||
self._run_test('POST', 400, None, {u'visibility': u'public', u'repository': 'XZGB',
|
||||
|
|
|
@ -1331,14 +1331,14 @@ class TestListRepos(ApiTestCase):
|
|||
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
def test_listrepos_orgmember(self):
|
||||
def test_listrepos_asorgmember(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
|
||||
# Queries: Base + the list query
|
||||
with assert_query_count(BASE_LOGGEDIN_QUERY_COUNT + 1):
|
||||
json = self.getJsonResponse(RepositoryList, params=dict(public=True))
|
||||
|
||||
self.assertGreater(len(json['repositories']), 1)
|
||||
self.assertGreater(len(json['repositories']), 0)
|
||||
|
||||
def test_listrepos_filter(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
|
@ -1353,7 +1353,7 @@ class TestListRepos(ApiTestCase):
|
|||
|
||||
def test_listrepos_limit(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
json = self.getJsonResponse(RepositoryList, params=dict(limit=1))
|
||||
json = self.getJsonResponse(RepositoryList, params=dict(limit=1, public=True))
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
def test_listrepos_allparams(self):
|
||||
|
|
Reference in a new issue