

def test_single(self):
    ' Test upload file with creation of intermediate folders '
    ftp_path = '/test/nest/luigi-test'
    local_filepath = '/tmp/luigi-test-ftp'
    with open(local_filepath, 'w') as outfile:
        outfile.write('something to fill')
    rfs = RemoteFileSystem(HOST, USER, PWD)
    rfs.put(local_filepath, ftp_path)
    ftp = ftplib.FTP(HOST, USER, PWD)
    ftp.cwd('/test/nest')
    list_dir = ftp.nlst()
    self.assertTrue(('luigi-test' in list_dir))
    ftp.delete('luigi-test')
    ftp.cwd('/')
    ftp.rmd('/test/nest')
    ftp.rmd('test')
    os.remove(local_filepath)
    ftp.close()

dataset/ETHPy150Open spotify/luigi/test/_test_ftp.py TestFTPFilesystemUpload.test_single/original