From e0072d5352c27dbaef4a95325ebf9e7af96f2991 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Thu, 19 Jun 2014 12:57:51 -0400 Subject: [PATCH] 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 --- cinder/tests/test_glusterfs.py | 2 ++ 1 file changed, 2 insertions(+) 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): -- 2.45.2