summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_torrent.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind@gmail.com>2018-06-01 15:35:19 +0100
committerCalum Lind <calumlind@gmail.com>2018-06-01 23:41:17 +0100
commitd642fa398924913c04eea3c2ddb769a4a6857fc3 (patch)
tree420c6e4d20b5550d1fc2ac2586968df4bf407ac6 /deluge/tests/test_torrent.py
parentbae1647e99e68244607e50633ca67a8c5b16ebfb (diff)
downloaddeluge-d642fa398924913c04eea3c2ddb769a4a6857fc3.tar.gz
deluge-d642fa398924913c04eea3c2ddb769a4a6857fc3.tar.bz2
deluge-d642fa398924913c04eea3c2ddb769a4a6857fc3.zip
Fix files to pass new Flake8 checkers
Some new flake8 checkers were added so fix these new warnings and any issues uncovered. Use add-trailing-comma to fix missing trailing commas. It does not format it as well as I would like however it was fast to change and helps with git changes in future. Removed pylint from tox due to large number of warnings.
Diffstat (limited to 'deluge/tests/test_torrent.py')
-rw-r--r--deluge/tests/test_torrent.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/deluge/tests/test_torrent.py b/deluge/tests/test_torrent.py
index ceb1d35e0..a4148d3d5 100644
--- a/deluge/tests/test_torrent.py
+++ b/deluge/tests/test_torrent.py
@@ -31,8 +31,10 @@ class TorrentTestCase(BaseTestCase):
def setup_config(self):
config_dir = common.set_tmp_config_dir()
- core_config = deluge.config.Config('core.conf', defaults=deluge.core.preferencesmanager.DEFAULT_PREFS,
- config_dir=config_dir)
+ core_config = deluge.config.Config(
+ 'core.conf', defaults=deluge.core.preferencesmanager.DEFAULT_PREFS,
+ config_dir=config_dir,
+ )
core_config.save()
def set_up(self):
@@ -77,8 +79,10 @@ class TorrentTestCase(BaseTestCase):
return atp
def test_set_prioritize_first_last_pieces(self):
- piece_indexes = [0, 1, 50, 51, 52, 110, 111, 112, 113, 200, 201, 202, 212,
- 213, 214, 215, 216, 217, 457, 458, 459, 460, 461, 462]
+ piece_indexes = [
+ 0, 1, 50, 51, 52, 110, 111, 112, 113, 200, 201, 202, 212,
+ 213, 214, 215, 216, 217, 457, 458, 459, 460, 461, 462,
+ ]
self.run_test_set_prioritize_first_last_pieces('dir_with_6_files.torrent', piece_indexes)
def run_test_set_prioritize_first_last_pieces(self, torrent_file, prioritized_piece_indexes):
@@ -169,7 +173,7 @@ class TorrentTestCase(BaseTestCase):
'num_seeds': 16777215, 'sequential_download': 0, 'announce_to_trackers': 1,
'peers': '\n\x00\x02\x0f=\xc6SC\x17]\xd8}\x7f\x00\x00\x01=\xc6', 'finished_time': 13399,
'last_upload': 13399, 'trackers': [[]], 'super_seeding': 0,
- 'file sizes': [[512000, 1411826586]], 'last_download': 13399
+ 'file sizes': [[512000, 1411826586]], 'last_download': 13399,
}
torrent_state = TorrentState(
torrent_id='2dc5d0e71a66fe69649a640d39cb00a259704973',
@@ -185,7 +189,8 @@ class TorrentTestCase(BaseTestCase):
filedump = _file.read()
resume_data = utf8_encode_structure(resume_data)
torrent_id = self.core.torrentmanager.add(
- state=torrent_state, filedump=filedump, resume_data=lt.bencode(resume_data))
+ state=torrent_state, filedump=filedump, resume_data=lt.bencode(resume_data),
+ )
torrent = self.core.torrentmanager.torrents[torrent_id]
def assert_resume_data():