def test_move(tmpdir, storages):
f = tmpdir.join('alpha')
f_http = Resource(storages['http']('/LICENSE'))
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()
with pytest.raises(transfert.exceptions.ReadOnlyResourceException):
transfert.actions.move(f_http, f_ftp, size=100)
assert f_ftp.exists() and f_http.exists()
transfert.actions.move(f_ftp, f_sftp, size=100)
assert not f_ftp.exists() and f_sftp.exists()
transfert.actions.move(f_sftp, f_file, size=100)
assert not f_sftp.exists() and f_file.exists()
评论列表
文章目录