tribler.test_unit.core.rss.test_rss

Classes

MockWatcher

Mocked RSSWatcher that doesn't communicate with the Internet.

TestRSSWatcher

Tests for the RSSWatcher class.

Module Contents

class tribler.test_unit.core.rss.test_rss.MockWatcher(task_manager: ipv8.taskmanager.TaskManager, notifier: tribler.core.notifier.Notifier, url: str)

Bases: tribler.core.rss.rss.RSSWatcher

Mocked RSSWatcher that doesn’t communicate with the Internet.

cg_response
cg_response_content = b'test'
async conditional_get(last_modified_time: float) tuple[aiohttp.ClientResponse, bytes]

Mocked get, return fixed response.

class tribler.test_unit.core.rss.test_rss.TestRSSWatcher

Bases: ipv8.test.base.TestBase

Tests for the RSSWatcher class.

setUp() None

Create a new tracker manager and a torrent checker.

test_restart() None

Check for gotcha’s with non-async adding and removing and task manager names.

async test_resolve() None

Test if torrent data can be resolved and a notification is sent.

async test_resolve_error() None

Test if no notification is not sent when a URL fails to resolve.

async test_resolve_malformed() None

Test if no notification is not sent when a URL resolves to bad metainfo.

async test_skip_check() None

Test if no notification is not sent when a URL resolves to bad metainfo.

async test_check_200() None

Test if a check schedules an RSS parsing of an HTTP 200 response.

async test_check_304() None

Test if a check does not schedule RSS parsing after an HTTP 304 response.

async test_check_connect_error() None

Test if a check can deal with connection errors to trackers.

async test_parse_rss_empty() None

Test if we don’t crash on parsing emtpy RSS contents.

async test_parse_rss_malformed() None

Test if we don’t crash on parsing malformed RSS contents.

async test_parse_rss_unusable() None

Test if we don’t crash on parsing unusable (no .torrents) RSS contents.

async test_parse_rss() None

Test if we extract all .torrents from RSS contents.

async test_parse_rss_old() None

Test if we ignore already-known .torrents from RSS contents.