Skip to content

Commit

Permalink
Adopt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Sep 9, 2022
1 parent 4e3cae5 commit 9af3a0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def on_save_resume_data_alert(self, alert):
Callback for the alert that contains the resume data of a specific download.
This resume data will be written to a file on disk.
"""
self._logger.debug(f'On save resume data alert: %s', alert)
self._logger.debug('On save resume data alert: %s', alert)
if self.checkpoint_disabled:
return

Expand Down
7 changes: 2 additions & 5 deletions src/tribler/core/components/libtorrent/tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,8 @@ def test_get_tracker_status_unicode_decode_error(test_download: Download):
In this test we ensures that this types of bugs don't affect `get_tracker_status` method.
See: https://github.com/Tribler/tribler/issues/7036
"""
fragile_dict = MagicMock(
__getitem__=MagicMock(side_effect=UnicodeDecodeError('', b'', 0, 0, ''))
)

test_download.handle = MagicMock(trackers=MagicMock(return_value=[fragile_dict]))
test_download.handle = MagicMock(trackers=MagicMock(side_effect=UnicodeDecodeError('', b'', 0, 0, '')))
test_download.get_tracker_status()

assert fragile_dict.__getitem__.called
assert test_download.handle.trackers.called

0 comments on commit 9af3a0b

Please sign in to comment.