btmon speeded up, all ICapTorrent backends clarified and fillobj cleaned
This commit is contained in:
parent
f6e2f0a657
commit
b907c8b266
10 changed files with 101 additions and 39 deletions
|
|
@ -52,8 +52,13 @@ class IsohuntBackend(BaseBackend, ICapTorrent):
|
|||
return self.browser.iter_torrents(pattern.replace(' ','+'))
|
||||
|
||||
def fill_torrent(self, torrent, fields):
|
||||
if 'description' in fields or fields == None or 'files' in fields:
|
||||
return self.get_torrent(torrent.id)
|
||||
if 'description' in fields or 'files' in fields:
|
||||
tor = self.get_torrent(torrent.id)
|
||||
torrent.description = tor.description
|
||||
torrent.magnet = tor.magnet
|
||||
torrent.files = tor.files
|
||||
torrent.url = tor.url
|
||||
return torrent
|
||||
|
||||
OBJECTS = {
|
||||
Torrent:fill_torrent
|
||||
|
|
|
|||
|
|
@ -19,10 +19,16 @@
|
|||
|
||||
from weboob.tools.test import BackendTest
|
||||
|
||||
from random import choice
|
||||
|
||||
class IsohuntTest(BackendTest):
|
||||
BACKEND = 'isohunt'
|
||||
|
||||
def test_torrent(self):
|
||||
l = list(self.backend.iter_torrents('debian'))
|
||||
if len(l) > 0:
|
||||
self.backend.get_torrent_file(l[0].id)
|
||||
if len(l):
|
||||
torrent = choice(l)
|
||||
full_torrent = self.backend.get_torrent(torrent.id)
|
||||
assert torrent.name
|
||||
assert full_torrent.name
|
||||
assert self.backend.get_torrent_file(torrent.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue