From 6843c096bf4e602e12134b6a1faac718df27253a Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 8 May 2013 13:41:48 +0200 Subject: [PATCH] Skip more tests that require Cinder backups Most of the unit tests that require the backups feature in python-cinderclient have been made optional, but a couple remained. This patch makes those also conditional on the feature being available. Change-Id: I8c954e7d7aa4b516b302140bfe5e66a7066717ed --- heat/tests/test_validate.py | 4 ++++ heat/tests/test_volume.py | 1 + 2 files changed, 5 insertions(+) diff --git a/heat/tests/test_validate.py b/heat/tests/test_validate.py index 127623b7..2c357b8e 100644 --- a/heat/tests/test_validate.py +++ b/heat/tests/test_validate.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from testtools import skipIf from heat.tests.v1_1 import fakes from heat.common import exception @@ -20,6 +21,7 @@ from heat.engine import resources from heat.engine.resources import instance as instances from heat.engine import resources from heat.engine import service +from heat.openstack.common.importutils import try_import import heat.db.api as db_api from heat.engine import parser from heat.tests.common import HeatTestCase @@ -475,6 +477,8 @@ class validateTest(HeatTestCase): self.assertEqual( res, {'Error': 'Snapshot DeletionPolicy not supported'}) + @skipIf(try_import('cinderclient.v1.volume_backups') is None, + 'unable to import volume_backups') def test_volume_snapshot_deletion_policy(self): t = template_format.parse(test_template_volume_snapshot) self.m.StubOutWithMock(instances.Instance, 'nova') diff --git a/heat/tests/test_volume.py b/heat/tests/test_volume.py index 880244b8..2804eb30 100644 --- a/heat/tests/test_volume.py +++ b/heat/tests/test_volume.py @@ -341,6 +341,7 @@ class VolumeTest(HeatTestCase): self.m.VerifyAll() + @skipIf(volume_backups is None, 'unable to import volume_backups') def test_create_from_snapshot(self): stack_name = 'test_volume_stack' fv = FakeVolume('creating', 'available') -- 2.45.2