'Check an image with container_format null is handled
Check an image with container_format null is handled when
marker is specified and order is ascending'

def test_image_get_all_marker_null_container_format_asc(self):

    TENANT1 = str(uuid.uuid4())
    ctxt1 = context.RequestContext(is_admin=False, tenant=TENANT1, auth_token=('user:%s:user' % TENANT1))
    UUIDX = str(uuid.uuid4())
    self.db_api.image_create(ctxt1, {'id': UUIDX, 'status': 'queued', 'container_format': None, 'owner': TENANT1})
    images = self.db_api.image_get_all(ctxt1, marker=UUIDX, sort_key=['container_format'], sort_dir=['asc'])
    image_ids = [image['id'] for image in images]
    expected = [UUID3, UUID2, UUID1]
    self.assertEqual(sorted(expected), sorted(image_ids))
