Merge pull request #1716 from coreos-inc/unicode-tags

Add a test for unicode tags to ensure they cannot be set
This commit is contained in:
josephschorr 2016-08-11 18:34:44 -04:00 committed by GitHub
commit d9b65b88e9

View file

@ -2333,6 +2333,29 @@ class TestRevertTag(ApiTestCase):
class TestListAndDeleteTag(ApiTestCase):
def test_invalid_tags(self):
self.login(ADMIN_ACCESS_USER)
# List the images for staging.
json = self.getJsonResponse(RepositoryTagImages,
params=dict(repository=ADMIN_ACCESS_USER + '/complex',
tag='staging'))
staging_images = json['images']
# Try to add some invalid tags.
self.putResponse(RepositoryTag,
params=dict(repository=ADMIN_ACCESS_USER + '/complex', tag='-fail'),
data=dict(image=staging_images[0]['id']),
expected_code=400)
self.putResponse(RepositoryTag,
params=dict(repository=ADMIN_ACCESS_USER + '/complex', tag='北京'),
data=dict(image=staging_images[0]['id']),
expected_code=400)
def test_listdeletecreateandmovetag(self):
self.login(ADMIN_ACCESS_USER)