Add parent mis-ordered registry test

This commit is contained in:
Joseph Schorr 2016-10-04 19:26:12 +03:00
parent 94a0fee63f
commit a046141708

View file

@ -1320,6 +1320,38 @@ class V1RegistryTests(V1RegistryPullMixin, V1RegistryPushMixin, RegistryTestsMix
class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMixin, class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMixin,
RegistryTestCaseMixin, LiveServerTestCase): RegistryTestCaseMixin, LiveServerTestCase):
""" Tests for V2 registry. """ """ Tests for V2 registry. """
def test_parent_misordered(self):
images = [
{
'id': 'latestid',
'contents': 'the latest image',
'parent': 'baseid',
},
{
'id': 'baseid',
'contents': 'The base image',
},
]
self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images,
expect_failure=FailureCodes.INVALID_REQUEST)
def test_invalid_parent(self):
images = [
{
'id': 'baseid',
'contents': 'The base image',
},
{
'id': 'latestid',
'contents': 'the latest image',
'parent': 'unknownparent',
},
]
self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images,
expect_failure=FailureCodes.INVALID_REQUEST)
def test_tags_pagination(self): def test_tags_pagination(self):
# Push 10 tags. # Push 10 tags.
tag_names = ['tag-%s' % i for i in range(0, 10)] tag_names = ['tag-%s' % i for i in range(0, 10)]