From c1c9c2883acc05f079b0446e7819634c8ebfc6e1 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 5 Nov 2020 23:18:04 -0300 Subject: [PATCH] fix some of the tests --- lbry/blockchain/sync/synchronizer.py | 3 ++- tests/integration/blockchain/test_blockchain.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lbry/blockchain/sync/synchronizer.py b/lbry/blockchain/sync/synchronizer.py index b48f9500b..95f70e34a 100644 --- a/lbry/blockchain/sync/synchronizer.py +++ b/lbry/blockchain/sync/synchronizer.py @@ -356,7 +356,8 @@ class BlockchainSync(Sync): async def sync_trends(self): ending_height = await self.chain.db.get_best_height() - await self.db.run(trending.calculate_trending, ending_height) + if ending_height is not None: + await self.db.run(trending.calculate_trending, ending_height) async def sync_claim_filtering(self): await self.db.run( diff --git a/tests/integration/blockchain/test_blockchain.py b/tests/integration/blockchain/test_blockchain.py index d4c62715b..d67b37c1f 100644 --- a/tests/integration/blockchain/test_blockchain.py +++ b/tests/integration/blockchain/test_blockchain.py @@ -293,8 +293,8 @@ class SyncingBlockchainTestCase(BasicBlockchainTestCase): async def state(self, controlling=None, active=None, accepted=None): self.assertEqual(controlling, await self.get_controlling()) - self.assertEqual(active or [], await self.get_active()) - self.assertEqual(accepted or [], await self.get_accepted()) + self.assertListEqual(active or [], await self.get_active()) + self.assertListEqual(accepted or [], await self.get_accepted()) class TestLbrycrdAPIs(AsyncioTestCase): @@ -832,7 +832,7 @@ class TestGeneralBlockchainSync(SyncingBlockchainTestCase): if support_channel is not None: r, = await self.db.search_supports() self.assertEqual(r.meta['is_signature_valid'], support_valid) - self.assertEqual(r.SUPPORT.signing_channel_id, support_channel.claim_id) + self.assertEqual(r.support.signing_channel_id, support_channel.claim_id) async def test_claim_and_support_signing(self): search = self.db.search_claims