def test_image_get_all_marker_deleted_showing_deleted(self): """Specify a deleted image as a marker if showing deleted images.""" db_api.image_destroy(self.adm_context, UUID1) filters = {'deleted': True} images = db_api.image_get_all(self.context, marker=UUID1, filters=filters) self.assertEquals(len(images), 0)
def _get_images(self, context, **params): """ Get images, wrapping in exception if necessary. """ try: return db_api.image_get_all(context, **params) except exception.NotFound, e: msg = _("Invalid marker. Image could not be found.") raise exc.HTTPBadRequest(explanation=msg)
def test_image_get_all_marker_deleted_showing_deleted_as_admin(self): """Specify a deleted image as a marker if showing deleted images.""" db_api.image_destroy(self.adm_context, UUID1) images = db_api.image_get_all(self.adm_context, marker=UUID1) self.assertEquals(len(images), 0)
def test_image_get_all_marker(self): images = db_api.image_get_all(self.context, marker=UUID2) self.assertEquals(len(images), 1)
def test_image_get_all(self): images = db_api.image_get_all(self.context) self.assertEquals(len(images), 2)