'Tests that the /images registry API returns list of
public images sorted by size in ascending order.'

def test_get_index_sort_size_asc(self):

    UUID3 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID3, disk_format='ami', container_format='ami', size=100)
    db_api.image_create(self.context, extra_fixture)
    UUID4 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID4, disk_format='iso', container_format='bare', size=2)
    db_api.image_create(self.context, extra_fixture)
    url = '/images?sort_key=size&sort_dir=asc'
    res = self.get_api_response_ext(http.OK, url=url)
    self.assertEqualImages(res, (UUID4, UUID2, UUID3))
