Пример #1
0
    def test_construct(self):

        ds = lt.dht_settings()

        print(ds.max_peers_reply)
        print(ds.search_branching)
        print(ds.max_fail_count)
        print(ds.max_fail_count)
        print(ds.max_torrents)
        print(ds.max_dht_items)
        print(ds.restrict_routing_ips)
        print(ds.restrict_search_ips)
        print(ds.max_torrent_search_reply)
        print(ds.extended_routing_table)
        print(ds.aggressive_lookups)
        print(ds.privacy_lookups)
        print(ds.enforce_node_id)
        print(ds.ignore_dark_internet)
        print(ds.block_timeout)
        print(ds.block_ratelimit)
        print(ds.read_only)
        print(ds.item_lifetime)
Пример #2
0
    def test_dht_settings(self) -> None:
        with self.assertWarns(DeprecationWarning):
            ds = lt.dht_settings()

        ds.max_peers_reply = 123
        self.assertEqual(ds.max_peers_reply, 123)

        ds.search_branching = 123
        self.assertEqual(ds.search_branching, 123)

        ds.max_fail_count = 123
        self.assertEqual(ds.max_fail_count, 123)

        ds.max_torrents = 123
        self.assertEqual(ds.max_torrents, 123)

        ds.max_dht_items = 123
        self.assertEqual(ds.max_dht_items, 123)

        self.assertTrue(ds.restrict_routing_ips)
        ds.restrict_routing_ips = False
        self.assertFalse(ds.restrict_routing_ips)

        self.assertTrue(ds.restrict_search_ips)
        ds.restrict_search_ips = False
        self.assertFalse(ds.restrict_search_ips)

        ds.max_torrent_search_reply = 123
        self.assertEqual(ds.max_torrent_search_reply, 123)

        self.assertTrue(ds.extended_routing_table)
        ds.extended_routing_table = False
        self.assertFalse(ds.extended_routing_table)

        self.assertTrue(ds.aggressive_lookups)
        ds.aggressive_lookups = False
        self.assertFalse(ds.aggressive_lookups)

        self.assertFalse(ds.privacy_lookups)
        ds.privacy_lookups = False
        self.assertFalse(ds.privacy_lookups)

        self.assertFalse(ds.enforce_node_id)
        ds.enforce_node_id = True
        self.assertTrue(ds.enforce_node_id)

        self.assertTrue(ds.ignore_dark_internet)
        ds.ignore_dark_internet = False
        self.assertFalse(ds.ignore_dark_internet)

        ds.block_timeout = 123
        self.assertEqual(ds.block_timeout, 123)

        ds.block_ratelimit = 123
        self.assertEqual(ds.block_ratelimit, 123)

        self.assertFalse(ds.read_only)
        ds.read_only = True
        self.assertTrue(ds.read_only)

        ds.item_lifetime = 123
        self.assertEqual(ds.item_lifetime, 123)
Пример #3
0
 def test_deprecated(self) -> None:
     with self.assertWarns(DeprecationWarning):
         lt.dht_settings()