예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
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)
예제 #4
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)
예제 #5
0
 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)
예제 #6
0
 def test_image_get_all_marker(self):
     images = db_api.image_get_all(self.context, marker=UUID2)
     self.assertEquals(len(images), 1)
예제 #7
0
 def test_image_get_all(self):
     images = db_api.image_get_all(self.context)
     self.assertEquals(len(images), 2)
예제 #8
0
 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)
예제 #9
0
 def test_image_get_all_marker(self):
     images = db_api.image_get_all(self.context, marker=UUID2)
     self.assertEquals(len(images), 1)
예제 #10
0
 def test_image_get_all(self):
     images = db_api.image_get_all(self.context)
     self.assertEquals(len(images), 2)