summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_torrent.py
diff options
context:
space:
mode:
authorDjLegolas <DjLegolas@users.noreply.github.com>2019-05-25 19:50:54 +0300
committerCalum Lind <calumlind+deluge@gmail.com>2019-06-05 15:09:00 +0100
commitd40d40af31aa878baf0ec4bf826b89ea6fb1b20b (patch)
tree9f276dacfb798c58d73dbed4cce383184d107c75 /deluge/tests/test_torrent.py
parentcbf9ee8978bff91104a934ec4e4008340077d0d2 (diff)
downloaddeluge-d40d40af31aa878baf0ec4bf826b89ea6fb1b20b.tar.gz
deluge-d40d40af31aa878baf0ec4bf826b89ea6fb1b20b.tar.bz2
deluge-d40d40af31aa878baf0ec4bf826b89ea6fb1b20b.zip
[Core] Update to support libtorrent 1.2
Some changes between lt 1.1 and 1.2 require updates to core code. - Switch from proxy_type to proxy_type_t - Replace hardcoded flag value with add_torrent_params_flags_t since 1.2 uses different flag values. - add_torrent_params requires flags set instead of dict values. Refs: #3255
Diffstat (limited to 'deluge/tests/test_torrent.py')
-rw-r--r--deluge/tests/test_torrent.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/deluge/tests/test_torrent.py b/deluge/tests/test_torrent.py
index 43d355bba..7bbe79ed8 100644
--- a/deluge/tests/test_torrent.py
+++ b/deluge/tests/test_torrent.py
@@ -73,12 +73,16 @@ class TorrentTestCase(BaseTestCase):
filename = common.get_test_data_file(filename)
with open(filename, 'rb') as _file:
info = lt.torrent_info(lt.bdecode(_file.read()))
- atp = {'ti': info}
- atp['save_path'] = os.getcwd()
- atp['storage_mode'] = lt.storage_mode_t.storage_mode_sparse
- atp['add_paused'] = False
- atp['auto_managed'] = True
- atp['duplicate_is_error'] = True
+ atp = {
+ 'ti': info,
+ 'save_path': os.getcwd(),
+ 'storage_mode': lt.storage_mode_t.storage_mode_sparse,
+ 'flags': (
+ lt.add_torrent_params_flags_t.flag_auto_managed
+ | lt.add_torrent_params_flags_t.flag_duplicate_is_error
+ & ~lt.add_torrent_params_flags_t.flag_paused
+ ),
+ }
return atp
def test_set_file_priorities(self):