expand content filtering tests for no_totals
This commit is contained in:
parent
a3e146dc68
commit
6a35a7ba4c
1 changed files with 12 additions and 3 deletions
|
@ -1367,6 +1367,11 @@ class StreamCommands(ClaimTestCase):
|
||||||
self.assertEqual(1, blocked['channels'][0]['blocked'])
|
self.assertEqual(1, blocked['channels'][0]['blocked'])
|
||||||
self.assertTrue(blocked['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
|
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
|
# search inside channel containing filtered content
|
||||||
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel'))
|
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel'))
|
||||||
filtered = result['blocked']
|
filtered = result['blocked']
|
||||||
|
@ -1379,9 +1384,6 @@ class StreamCommands(ClaimTestCase):
|
||||||
# same search, but details omitted by 'no_totals'
|
# same search, but details omitted by 'no_totals'
|
||||||
last_result = result
|
last_result = result
|
||||||
result = await self.out(self.daemon.jsonrpc_claim_search(channel='@some_channel', no_totals=True))
|
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'])
|
self.assertEqual(result['items'], last_result['items'])
|
||||||
|
|
||||||
# content was filtered by not_tag before censoring
|
# content was filtered by not_tag before censoring
|
||||||
|
@ -1437,6 +1439,13 @@ class StreamCommands(ClaimTestCase):
|
||||||
self.assertEqual(3, filtered['channels'][0]['blocked'])
|
self.assertEqual(3, filtered['channels'][0]['blocked'])
|
||||||
self.assertTrue(filtered['channels'][0]['channel']['short_url'].startswith('lbry://@filtering#'))
|
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
|
# filtered channel should still resolve
|
||||||
result = await self.resolve('lbry://@bad_channel')
|
result = await self.resolve('lbry://@bad_channel')
|
||||||
self.assertEqual(bad_channel_id, result['claim_id'])
|
self.assertEqual(bad_channel_id, result['claim_id'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue