Source code for pyquickhelper.filehelper.ftp_transfer_mock

"""
Mock class :class:`TransferFTP <pyquickhelper.filehelper.ftp_transfer.TransferFTP>`


:githublink:`%|py|5`
"""
from ftplib import FTP
from ..loghelper.flog import noLOG
from .ftp_transfer import TransferFTP


[docs]class MockTransferFTP (TransferFTP): """ mock :class:`TransferFTP <pyquickhelper.filehelper.ftp_transfer.TransferFTP>` :githublink:`%|py|14` """
[docs] def __init__(self, site, login, password, fLOG=noLOG): # pylint: disable=W0231 """ same signature as :class:`TransferFTP <pyquickhelper.filehelper.ftp_transfer.TransferFTP>` :githublink:`%|py|19` """ self._logins = [] self._ftp = FTP(None) self.LOG = fLOG self._atts = dict(site=site, login=login, password=password)
[docs] def transfer(self, file, to, name, debug=False, blocksize=None, callback=None): """ does nothing, returns True :githublink:`%|py|28` """ return True
[docs] def close(self): """ does noting :githublink:`%|py|34` """ pass