]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Skip more tests that require Cinder backups
authorZane Bitter <zbitter@redhat.com>
Wed, 8 May 2013 11:41:48 +0000 (13:41 +0200)
committerZane Bitter <zbitter@redhat.com>
Wed, 8 May 2013 11:41:48 +0000 (13:41 +0200)
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
heat/tests/test_volume.py

index 127623b7b1df55b6e29ce746f2811ba1f9cd4f77..2c357b8eb319401293c02b3a0b1c308ea3764d5d 100644 (file)
@@ -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')
index 880244b8ada8502d3f18e5efbc52a79e47b42754..2804eb30607c36ae33a4b23fff8df49b40bc9bac 100644 (file)
@@ -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')