

def test_put(self):
    ' Test RemoteTarget put method with uploading to an FTP '
    local_filepath = '/tmp/luigi-remotetarget-write-test'
    remote_file = '/test/example.put.file'
    with open(local_filepath, 'w') as outfile:
        list_dir.write('something to fill')
    remotetarget = RemoteTarget(remote_file, HOST, username=USER, password=PWD)
    remotetarget.put(local_filepath)
    ftp = ftplib.FTP(HOST, USER, PWD)
    ftp.cwd('/test')
    list_dir = ftp.nlst()
    self.assertTrue((remote_file.split('/')[(- 1)] in list_dir))
    os.remove(local_filepath)
    ftp.delete(remote_file)
    ftp.cwd('/')
    ftp.rmd('test')
    ftp.close()

dataset/ETHPy150Open spotify/luigi/test/_test_ftp.py TestRemoteTarget.test_put/VarMisuse@32/85 `outfile`->`list_dir`