Add parent mis-ordered registry test
This commit is contained in:
parent
94a0fee63f
commit
a046141708
1 changed files with 32 additions and 0 deletions
|
@ -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)]
|
||||||
|
|
Reference in a new issue