Allow to sort 'all' by 'type_name'
Change-Id: Iced8a08e1e3a9a1aa296a77d7c6259faf3fd1f95
This commit is contained in:
parent
2924e662cb
commit
8d4806fc8d
|
@ -28,7 +28,8 @@ class All(base.BaseArtifact):
|
|||
|
||||
fields = {
|
||||
'type_name': Field(fields.StringField,
|
||||
description="Name of artifact type."),
|
||||
description="Name of artifact type.",
|
||||
sortable=True),
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -55,6 +55,12 @@ class TestAll(base.TestArtifact):
|
|||
for art in res:
|
||||
self.assertIn(art['type_name'], ('images', 'heat_templates'))
|
||||
|
||||
# get all artifacts sorted by type_name
|
||||
url = '/all?sort=type_name:asc&limit=100'
|
||||
res = self.get(url=url, status=200)['artifacts']
|
||||
self.assertEqual(54, len(res))
|
||||
self.assertEqual(sorted(res, key=lambda x: x['type_name']), res)
|
||||
|
||||
def test_all_readonlyness(self):
|
||||
self.create_artifact(data={'name': 'all'}, type_name='all', status=403)
|
||||
art = self.create_artifact(data={'name': 'image'}, type_name='images')
|
||||
|
|
|
@ -929,6 +929,7 @@ fixtures = {
|
|||
u'filter_ops': [u'eq', u'neq', u'in'],
|
||||
u'glareType': u'String',
|
||||
u'maxLength': 255,
|
||||
u'sortable': True,
|
||||
u'type': [u'string', u'null']},
|
||||
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue