Пример #1
0
 def test_trackers_and_private(self):
     tc = torrent._is_isolated({
         'isPrivate':
         True,
         'trackerStats': [{
             'lastAnnounceSucceeded': False,
             'hasAnnounced': False
         }, {
             'lastAnnounceSucceeded': False,
             'hasAnnounced': True
         }]
     })
     self.assertEqual(tc, True)
     tc = torrent._is_isolated({
         'isPrivate':
         True,
         'trackerStats': [{
             'lastAnnounceSucceeded': False,
             'hasAnnounced': False
         }, {
             'lastAnnounceSucceeded': True,
             'hasAnnounced': True
         }]
     })
     self.assertEqual(tc, False)
Пример #2
0
 def test_no_trackers_and_private(self):
     tc = torrent._is_isolated({'isPrivate': True, 'trackerStats': []})
     self.assertEqual(tc, True)
Пример #3
0
 def test_no_trackers_and_public(self):
     tc = torrent._is_isolated({'isPrivate': False, 'trackerStats': []})
     self.assertEqual(tc, False)