Skip to content

Commit 1fc7136

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "os.path.exists should be mocked in test case"
2 parents 1e04c8f + d1b30a1 commit 1fc7136

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • ironic_python_agent/tests/extensions

ironic_python_agent/tests/extensions/iscsi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
import mock
19+
import os
1920
import time
2021

2122
from oslo_concurrency import processutils
@@ -64,6 +65,7 @@ def test_start_iscsi_target(self, mock_wait_iscsi, mock_execute,
6465
self.assertEqual({'iscsi_target_iqn': self.fake_iqn},
6566
result.command_result)
6667

68+
@mock.patch.object(os.path, 'exists', lambda x: False)
6769
def test_start_iscsi_target_fail_wait_daemon(self, mock_execute,
6870
mock_dispatch):
6971
mock_dispatch.return_value = self.fake_dev

0 commit comments

Comments
 (0)