]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Tests: Fix os.path.exists mock (emc_vnxdirect)
authorEric Harney <eharney@redhat.com>
Thu, 6 Aug 2015 22:31:41 +0000 (16:31 -0600)
committerEric Harney <eharney@redhat.com>
Thu, 6 Aug 2015 22:35:25 +0000 (16:35 -0600)
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

index 7b50c54ebd20e41543f5baa20b169464566660af..90e61ddb47f06d92193d2158c01a49f6f2794eb3 100644 (file)
@@ -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