From 6a35a7ba4c7f36f4a74b8334e2e31005a5ede507 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 14 Mar 2021 22:39:31 -0300 Subject: [PATCH] expand content filtering tests for no_totals --- .../integration/blockchain/test_claim_commands.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/integration/blockchain/test_claim_commands.py b/tests/integration/blockchain/test_claim_commands.py index 5fb8bacc8..ab373e702 100644 --- a/tests/integration/blockchain/test_claim_commands.py +++ b/tests/integration/blockchain/test_claim_commands.py @@ -1367,6 +1367,11 @@ class StreamCommands(ClaimTestCase): self.assertEqual(1, blocked['channels'][0]['blocked']) self.assertTrue(blocked['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#')) + # same search, but details omitted by 'no_totals' + last_result = result + result = await self.out(self.daemon.jsonrpc_claim_search(name='bad_content', no_totals=True)) + self.assertEqual(result['items'], last_result['items']) + # search inside channel containing filtered content result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel')) filtered = result['blocked'] @@ -1379,9 +1384,6 @@ class StreamCommands(ClaimTestCase): # same search, but details omitted by 'no_totals' last_result = result result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel', no_totals=True)) - filtered = result['blocked'] - self.assertEqual(0, filtered['total']) - self.assertEqual(0, len(filtered['channels'])) self.assertEqual(result['items'], last_result['items']) # content was filtered by not_tag before censoring @@ -1437,6 +1439,13 @@ class StreamCommands(ClaimTestCase): self.assertEqual(3, filtered['channels'][0]['blocked']) self.assertTrue(filtered['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#')) + # same search, but details omitted by 'no_totals' + last_result = result + result = await self.out( + self.daemon.jsonrpc_claim_search(any_tags=['bad-stuff'], order_by=['height'], no_totals=True) + ) + self.assertEqual(result['items'], last_result['items']) + # filtered channel should still resolve result = await self.resolve('lbry://@bad_channel') self.assertEqual(bad_channel_id, result['claim_id'])