]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Minor cleanups in test_volume
authorEric Harney <eharney@redhat.com>
Mon, 14 Apr 2014 18:27:06 +0000 (14:27 -0400)
committerEric Harney <eharney@redhat.com>
Mon, 23 Jun 2014 15:34:57 +0000 (11:34 -0400)
Fix incorrect parameter order for mock decorators.  This
just happened to work because they were used in the same way
in test_reserve_volume_success().

Remove incorrect comments.  These seem to mix up 'error' versus
'error_deleting' for expected states -- but the assertEqual args
are sufficiently explanatory by themselves.

Change-Id: I763265b8365d3b2fcece94b14639a1bed7b6a848

cinder/tests/test_volume.py

index 6b53c5d6004197f67ad3f46e133d0210885b9b18..2873b5d18955c101cd36f01df9d0e64ab7bfb905 100644 (file)
@@ -276,7 +276,6 @@ class VolumeTestCase(BaseVolumeTestCase):
                           self.volume.create_volume,
                           self.context, volume_id)
 
-        # NOTE(flaper87): The volume status should be error_deleting.
         volume = db.volume_get(context.get_admin_context(), volume_id)
         self.assertEqual(volume.status, "error")
         db.volume_destroy(context.get_admin_context(), volume_id)
@@ -310,7 +309,6 @@ class VolumeTestCase(BaseVolumeTestCase):
                           self.volume.delete_volume,
                           self.context, volume_id)
 
-        # NOTE(flaper87): The volume status should be error.
         volume = db.volume_get(context.get_admin_context(), volume_id)
         self.assertEqual(volume.status, "error_deleting")
         db.volume_destroy(context.get_admin_context(), volume_id)
@@ -1490,8 +1488,8 @@ class VolumeTestCase(BaseVolumeTestCase):
         self.assertEqual(admin_metadata[0]['key'], 'readonly')
         self.assertEqual(admin_metadata[0]['value'], 'True')
 
-    @mock.patch.object(db, 'volume_get')
     @mock.patch.object(cinder.volume.api.API, 'update')
+    @mock.patch.object(db, 'volume_get')
     def test_reserve_volume_success(self, volume_get, volume_update):
         fake_volume = {
             'id': FAKE_UUID,