def test_refresh_path_exists(self, mock_exists, mock_refresh): mock_exists.return_value = True mpath_dmp.refresh('360a98000534b4f4e46704f5270674d70', 0) mock_refresh.assert_called_once_with( '360a98000534b4f4e46704f5270674d70', 0) mock_exists.assert_called_once_with( '/dev/disk/by-id/scsi-360a98000534b4f4e46704f5270674d70')
def test_refresh_refresh_error(self, context, mock_exists, mock_scsiutil, mock_wait): # Setup error codes context.setup_error_codes() def exists(path): print('Exists %s' % path) if path.startswith('/dev/'): return False return True mock_exists.side_effect = exists mock_wait.return_value = False with self.assertRaises(SR.SROSError): mpath_dmp.refresh('360a98000534b4f4e46704f5270674d70', 0)
def test_refresh_no_sid(self, context): # Setup error codes context.setup_error_codes() with self.assertRaises(SR.SROSError): mpath_dmp.refresh("", 0)