' sid:844427031282176 initiator:iqn.1994-05.com.redhat:5a6894679665\n' # noqa
' cid:0 ip:10.9.8.7 state:active hd:none dd:none')
tmp_file.seek(0)
- with mock.patch('__builtin__.open') as mock_open:
+ with mock.patch('six.moves.builtins.open') as mock_open:
mock_open.return_value = contextlib.closing(tmp_file)
self.assertEqual('1',
self.target._get_target(
))
# Test the failure case: Failed to handle the config file
- mock_open.side_effect = StandardError()
- self.assertRaises(StandardError,
+ mock_open.side_effect = MemoryError()
+ self.assertRaises(MemoryError,
self.target._get_target,
'')
@mock.patch('cinder.utils.execute')
@mock.patch('os.path.exists', return_value=True)
@mock.patch('cinder.utils.temporary_chown')
- def test_create_iscsi_target(self, mock_chown, mock_exists,
+ @mock.patch.object(iet, 'LOG')
+ def test_create_iscsi_target(self, mock_log, mock_chown, mock_exists,
mock_execute, mock_get_targ):
mock_execute.return_value = ('', '')
tmp_file = six.StringIO()
- with mock.patch('__builtin__.open') as mock_open:
+ with mock.patch('six.moves.builtins.open') as mock_open:
mock_open.return_value = contextlib.closing(tmp_file)
self.assertEqual(
0,
' sid:844427031282176 initiator:iqn.1994-05.com.redhat:5a6894679665\n' # noqa
' cid:0 ip:10.9.8.7 state:active hd:none dd:none')
tmp_file.seek(0)
- with mock.patch('__builtin__.open') as mock_open:
+ with mock.patch('six.moves.builtins.open') as mock_open:
mock_open.return_value = contextlib.closing(tmp_file)
self.assertEqual(('844427031282176', '0'),
self.target._find_sid_cid_for_target(
cinder.tests.unit.scheduler.test_volume_number_weigher
cinder.tests.unit.targets.test_base_iscsi_driver
cinder.tests.unit.targets.test_cxt_driver
+cinder.tests.unit.targets.test_iet_driver
cinder.tests.unit.targets.test_iser_driver
cinder.tests.unit.targets.test_lio_driver
cinder.tests.unit.targets.test_scst_driver