From: Eric Harney Date: Thu, 19 Jun 2014 16:57:51 +0000 (-0400) Subject: GlusterFS tests: Mock out compute, don't load novaclient X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e0072d5352c27dbaef4a95325ebf9e7af96f2991;p=openstack-build%2Fcinder-build.git GlusterFS tests: Mock out compute, don't load novaclient Mock out the compute library for these tests, which prevents loading the novaclient library. This makes these tests more reliable, as currently the novaclient lib interferes with our mocking of os.path.exists in these tests in some test configurations. This should also make the GlusterFS tests slightly more efficient since they were previously loading the novaclient python library but did not really need to. Change-Id: I49e858b8536e30572b6231f209a35578460fff96 --- diff --git a/cinder/tests/test_glusterfs.py b/cinder/tests/test_glusterfs.py index 82ed0321c..3ea42b4e2 100644 --- a/cinder/tests/test_glusterfs.py +++ b/cinder/tests/test_glusterfs.py @@ -27,6 +27,7 @@ from mox import stubout from oslo.config import cfg from cinder import brick +from cinder import compute from cinder import context from cinder import db from cinder import exception @@ -98,6 +99,7 @@ class GlusterFsDriverTestCase(test.TestCase): glusterfs.GlusterfsDriver(configuration=self._configuration, db=FakeDb()) self._driver.shares = {} + compute.API = mock.MagicMock() self.addCleanup(self._mox.UnsetStubs) def stub_out_not_replaying(self, obj, attr_name):