Merge pull request #3395 from lbryio/libtorrent_optional

make libtorrent optional and skip test which depends on it
This commit is contained in:
Lex Berezhny 2021-08-13 10:31:06 -04:00 committed by GitHub
commit 4ddff96b1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,11 @@
from unittest import skipIf
import asyncio import asyncio
import os import os
from binascii import hexlify from binascii import hexlify
from lbry.schema import Claim from lbry.schema import Claim
from lbry.testcase import CommandTestCase from lbry.testcase import CommandTestCase
from lbry.torrent.session import TorrentSession from lbry.extras.daemon.components import TorrentSession
from lbry.wallet import Transaction from lbry.wallet import Transaction
@ -40,6 +41,7 @@ class FileCommands(CommandTestCase):
self.client_session.wait_start = False # fixme: this is super slow on tests self.client_session.wait_start = False # fixme: this is super slow on tests
return tx, btih return tx, btih
@skipIf(TorrentSession is None, "libtorrent not installed")
async def test_download_torrent(self): async def test_download_torrent(self):
tx, btih = await self.initialize_torrent() tx, btih = await self.initialize_torrent()
self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent'))) self.assertNotIn('error', await self.out(self.daemon.jsonrpc_get('torrent')))