From c0bce8cdf56acef9441f88d12cda2ae43538318a Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 25 Jan 2017 11:09:44 -0500 Subject: [PATCH] Tests: Fix mock for vzstorage remotefs This needs to be added to prevent writing a file during unit tests. Closes-Bug: #1659295 Change-Id: Ic03d1254b3187785f276e4f745f3ba230078e017 --- cinder/tests/unit/volume/drivers/test_vzstorage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/tests/unit/volume/drivers/test_vzstorage.py b/cinder/tests/unit/volume/drivers/test_vzstorage.py index 987e5f90ed7..4c99b71398f 100644 --- a/cinder/tests/unit/volume/drivers/test_vzstorage.py +++ b/cinder/tests/unit/volume/drivers/test_vzstorage.py @@ -315,7 +315,9 @@ class VZStorageTestCase(test.TestCase): self._FAKE_VOLUME_PATH) drv._delete.assert_any_call(fake_vol_info) - def test_delete_snapshot_ploop(self): + @mock.patch('cinder.volume.drivers.remotefs.RemoteFSSnapDriverBase.' + '_write_info_file') + def test_delete_snapshot_ploop(self, _mock_write_info_file): fake_snap_info = { 'active': self._FAKE_VOLUME_NAME, self._FAKE_SNAPSHOT_ID: self._FAKE_SNAPSHOT_PATH,