def setUp(self): super(WindowsRemoteFsTestCase, self).setUp() with mock.patch.object(remotefs.WindowsRemoteFsClient, '__init__', lambda x: None): self._remotefs = remotefs.WindowsRemoteFsClient() self._remotefs._mount_base = mock.sentinel.mnt_base self._remotefs._smbutils = mock.Mock() self._remotefs._pathutils = mock.Mock()
def __init__(self, *args, **kwargs): super(WindowsSmbfsDriver, self).__init__(*args, **kwargs) self.base = getattr(self.configuration, 'smbfs_mount_point_base', CONF.smbfs_mount_point_base) opts = getattr(self.configuration, 'smbfs_mount_options', CONF.smbfs_mount_options) self._remotefsclient = remotefs.WindowsRemoteFsClient( 'cifs', root_helper=None, smbfs_mount_point_base=self.base, smbfs_mount_options=opts) self.vhdutils = vhdutils.VHDUtils()
def setUp(self): super(WindowsRemoteFsTestCase, self).setUp() remotefs.ctypes.windll = mock.MagicMock() remotefs.WindowsRemoteFsClient.__init__ = mock.Mock(return_value=None) self._remotefs = remotefs.WindowsRemoteFsClient( 'cifs', root_helper=None, smbfs_mount_point_base=self._FAKE_MNT_BASE) self._remotefs._mount_base = self._FAKE_MNT_BASE self._remotefs.smb_conn = mock.MagicMock() self._remotefs.conn_cimv2 = mock.MagicMock()