Here are the examples of the python api mock.sentinel.initiator_1 taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
Project: compute-hyperv Source File: test_volumeops.py
@ddt.data([mock.sentinel.initiator_1, mock.sentinel.initiator_2], [])
@mock.patch.object(volumeops.ISCSIVolumeDriver, '_get_all_targets')
def test_get_all_paths(self, requested_initiators, mock_get_all_targets):
self.flags(iscsi_initiator_list=requested_initiators, group='hyperv')
target = (mock.sentinel.portal, mock.sentinel.target,
mock.sentinel.lun)
mock_get_all_targets.return_value = [target]
paths = self._volume_driver._get_all_paths(mock.sentinel.conn_props)
expected_initiators = requested_initiators or [None]
expected_paths = [(initiator, ) + target
for initiator in expected_initiators]
self.assertEqual(expected_paths, paths)
mock_get_all_targets.assert_called_once_with(mock.sentinel.conn_props)