From e49f24e95ffc2817c752c2faab9a888fac41932e Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 14 Nov 2019 15:32:38 -0500 Subject: [PATCH] added more tests to make sure stream update and abandon update the full text search indexes --- lbry/lbry/wallet/server/db/full_text_search.py | 2 +- lbry/tests/integration/test_claim_commands.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lbry/lbry/wallet/server/db/full_text_search.py b/lbry/lbry/wallet/server/db/full_text_search.py index eccf798dc..f24db79eb 100644 --- a/lbry/lbry/wallet/server/db/full_text_search.py +++ b/lbry/lbry/wallet/server/db/full_text_search.py @@ -22,7 +22,7 @@ def fts_action_sql(claims=None, action='insert'): 'tags': "(select group_concat(tag, ' ') from tag where tag.claim_hash=claim.claim_hash)" } if action == 'delete': - select['search'] = 'delete' + select['search'] = '"delete"' where, values = "", {} if claims: diff --git a/lbry/tests/integration/test_claim_commands.py b/lbry/tests/integration/test_claim_commands.py index b4d8867f7..5558bc89e 100644 --- a/lbry/tests/integration/test_claim_commands.py +++ b/lbry/tests/integration/test_claim_commands.py @@ -355,11 +355,25 @@ class ClaimSearchCommand(ClaimTestCase): ) await self.assertFindsClaims([], text='cheese') + await self.assertFindsClaims([claim2], text='autobiography') await self.assertFindsClaims([claim3], text='history') await self.assertFindsClaims([claim4], text='conspiracy') + await self.assertFindsClaims([], text='conspiracy AND history') + await self.assertFindsClaims([claim4, claim3], text='conspiracy OR history') await self.assertFindsClaims([claim1, claim4, claim2, claim3], text='documentary') await self.assertFindsClaims([claim4, claim1, claim2, claim3], text='satoshi') + claim2 = await self.stream_update( + self.get_claim_id(claim2), clear_tags=True, tags=['cloud'], + title="Satoshi Nakamoto Nography", + description="I am Satoshi Nakamoto and this is my nography.", + ) + await self.assertFindsClaims([], text='autobiography') + await self.assertFindsClaims([claim2], text='cloud') + + await self.stream_abandon(self.get_claim_id(claim2)) + await self.assertFindsClaims([], text='cloud') + class ChannelCommands(CommandTestCase):