From 04f0b99ca017dea17fb362ef36e4dd8c524c718e Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 14 Apr 2014 14:27:06 -0400 Subject: [PATCH] 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 --- cinder/tests/test_volume.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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, -- 2.45.2