Add test for bad repo names currently breaking quay

This commit is contained in:
Joseph Schorr 2014-03-11 13:38:44 -04:00
parent 9ca41dec95
commit e4d40e3289

View file

@ -767,6 +767,28 @@ class TestDeleteRepository(ApiTestCase):
class TestGetRepository(ApiTestCase):
PUBLIC_REPO = PUBLIC_USER + '/publicrepo'
def test_getrepo_badnames(self):
self.login(ADMIN_ACCESS_USER)
bad_names = ['logs', 'build', 'tokens']
# For each bad name, create the repo.
for bad_name in bad_names:
json = self.postJsonResponse('api.create_repo',
data=dict(repository=bad_name,
visibility='public',
description=''))
# Make sure we can retrieve its information.
json = self.getJsonResponse('api.get_repo',
params=dict(repository=ADMIN_ACCESS_USER + '/' + bad_name))
self.assertEquals(ADMIN_ACCESS_USER, json['namespace'])
self.assertEquals(bad_name, json['name'])
self.assertEquals(True, json['is_public'])
def test_getrepo_public_asguest(self):
json = self.getJsonResponse('api.get_repo',
params=dict(repository=self.PUBLIC_REPO))