'Tests that the registry API returns list of public images.
Must be sorted by created_at in ascending order.'

def test_get_index_sort_created_at_asc(self):

    uuid4_time = (timeutils.utcnow() + datetime.timedelta(seconds=10))
    uuid3_time = (uuid4_time + datetime.timedelta(seconds=5))
    UUID3 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID3, created_at=uuid3_time)
    db_api.image_create(self.context, extra_fixture)
    UUID4 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID4, created_at=uuid4_time)
    db_api.image_create(self.context, extra_fixture)
    images = self.client.image_get_all(sort_key=['created_at'], sort_dir=['asc'])
    self.assertEqualImages(images, (UUID1, UUID2, UUID4, UUID3), unjsonify=False)
