From: Eric Harney Date: Mon, 14 Apr 2014 18:27:06 +0000 (-0400) Subject: Minor cleanups in test_volume X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=04f0b99ca017dea17fb362ef36e4dd8c524c718e;p=openstack-build%2Fcinder-build.git Minor cleanups in test_volume 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 --- diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 6b53c5d60..2873b5d18 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -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,