def test_copy(tmpdir, storages):
f = tmpdir.join('alpha')
f.write_binary(os.urandom(1024 * 40))
f_http = Resource(storages['http']('index.html'))
f_file = Resource(storages['file'](f.strpath))
f_sftp = Resource(storages['sftp']('/gamma'))
f_ftp = Resource(storages['ftp']('/beta'))
assert f_http.exists()
delete_files(f_file, f_sftp, f_ftp)
assert not f_file.exists()\
and not f_sftp.exists()\
and not f_ftp.exists()
transfert.actions.copy(f_http, f_ftp, size=40960)
assert f_ftp.exists() and f_http.exists()
transfert.actions.copy(f_ftp, f_sftp, size=40960)
assert f_ftp.exists() and f_sftp.exists()
transfert.actions.copy(f_sftp, f_file, size=40960)
assert f_sftp.exists() and f_file.exists()
评论列表
文章目录