From 56af4c2fcb8e6d8b8bde5dc8cc0b2f261bc53305 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 3 Nov 2019 20:57:39 -0300 Subject: [PATCH] minor fixes from rebase --- lbry/lbry/testcase.py | 12 ++++-------- lbry/tests/integration/test_claim_commands.py | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lbry/lbry/testcase.py b/lbry/lbry/testcase.py index 5e013250e..bd888858d 100644 --- a/lbry/lbry/testcase.py +++ b/lbry/lbry/testcase.py @@ -204,15 +204,11 @@ class CommandTestCase(IntegrationTestCase): """ Synchronous version of `out` method. """ return json.loads(jsonrpc_dumps_pretty(value, ledger=self.ledger))['result'] - async def stream_repost(self, claim_id, name='repost', bid='1.0', **kwargs): - tx = await self.out( - self.daemon.jsonrpc_stream_repost(claim_id=claim_id, name=name, bid=bid, **kwargs) + def stream_repost(self, claim_id, name='repost', bid='1.0', confirm=True, **kwargs): + return self.confirm_and_render( + self.daemon.jsonrpc_stream_repost(claim_id=claim_id, name=name, bid=bid, **kwargs), + confirm ) - if kwargs.get('confirm', True): - await self.on_transaction_dict(tx) - await self.generate(1) - await self.on_transaction_dict(tx) - return tx async def confirm_and_render(self, awaitable, confirm) -> Transaction: tx = await awaitable diff --git a/lbry/tests/integration/test_claim_commands.py b/lbry/tests/integration/test_claim_commands.py index 8da6de500..81da9ca89 100644 --- a/lbry/tests/integration/test_claim_commands.py +++ b/lbry/tests/integration/test_claim_commands.py @@ -719,12 +719,12 @@ class StreamCommands(ClaimTestCase): tx = await self.out(self.stream_create('newstuff', '1.1', channel_name='@goodies')) claim_id = tx['outputs'][0]['claim_id'] await self.stream_repost(claim_id, 'newstuff-again', '1.1') - claim_list = await self.out(self.daemon.jsonrpc_claim_list()) + claim_list = (await self.out(self.daemon.jsonrpc_claim_list()))['items'] reposts_on_claim_list = [claim for claim in claim_list if claim['value_type'] == 'repost'] self.assertEqual(len(reposts_on_claim_list), 1) await self.out(self.channel_create('@reposting-goodies', '1.0')) await self.stream_repost(claim_id, 'repost-on-channel', '1.1', channel_name='@reposting-goodies') - claim_list = await self.out(self.daemon.jsonrpc_claim_list()) + claim_list = (await self.out(self.daemon.jsonrpc_claim_list()))['items'] reposts_on_claim_list = [claim for claim in claim_list if claim['value_type'] == 'repost'] self.assertEqual(len(reposts_on_claim_list), 2) signed_reposts = [repost for repost in reposts_on_claim_list if repost.get('is_channel_signature_valid')]