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:
commit
d9b65b88e9
1 changed files with 23 additions and 0 deletions
|
@ -2333,6 +2333,29 @@ class TestRevertTag(ApiTestCase):
|
||||||
|
|
||||||
|
|
||||||
class TestListAndDeleteTag(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):
|
def test_listdeletecreateandmovetag(self):
|
||||||
self.login(ADMIN_ACCESS_USER)
|
self.login(ADMIN_ACCESS_USER)
|
||||||
|
|
||||||
|
|
Reference in a new issue