From 6f04677640a7acfb8c8965e5d44534b04d00778b Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Thu, 6 Aug 2015 16:31:41 -0600 Subject: [PATCH] Tests: Fix os.path.exists mock (emc_vnxdirect) Use mock rather than assigning to os.path.exists, since this may cause later tests to break. Change-Id: I028aee93c92d5fafb4da018925d20db18c962eed --- cinder/tests/unit/test_emc_vnxdirect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/tests/unit/test_emc_vnxdirect.py b/cinder/tests/unit/test_emc_vnxdirect.py index 7b50c54eb..90e61ddb4 100644 --- a/cinder/tests/unit/test_emc_vnxdirect.py +++ b/cinder/tests/unit/test_emc_vnxdirect.py @@ -2200,9 +2200,9 @@ Time Remaining: 0 second(s) ] fake_cli.assert_has_calls(expected) - def test_terminate_connection(self): + @mock.patch('os.path.exists', return_value=True) + def test_terminate_connection(self, _mock_exists): - os.path.exists = mock.Mock(return_value=1) self.driver = emc_cli_iscsi.EMCCLIISCSIDriver( configuration=self.configuration) cli_helper = self.driver.cli._client -- 2.45.2