From 58f4585b530941ee1243cbfb52390c6a257ecc24 Mon Sep 17 00:00:00 2001
From: Holger <holger@nahrstaedt.de>
Date: Fri, 15 Jun 2018 14:58:46 +0200
Subject: [PATCH] Try to fix unit test

---
 tests/beem/test_blockchain_threading.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/beem/test_blockchain_threading.py b/tests/beem/test_blockchain_threading.py
index 83256f45..e5d5e743 100644
--- a/tests/beem/test_blockchain_threading.py
+++ b/tests/beem/test_blockchain_threading.py
@@ -26,6 +26,7 @@ class Testcases(unittest.TestCase):
         cls.bts = Steem(
             node=nodelist.get_nodes(appbase=False),
             nobroadcast=True,
+            timeout=30,
             num_retries=10,
             keys={"active": wif},
         )
@@ -35,7 +36,8 @@ class Testcases(unittest.TestCase):
         cls.bts.set_default_account("test")
 
         b = Blockchain(steem_instance=cls.bts)
-        num = b.get_current_block_num()
+        # num = b.get_current_block_num()
+        num = 2000000
         cls.start = num - 25
         cls.stop = num
 
@@ -44,14 +46,19 @@ class Testcases(unittest.TestCase):
         b = Blockchain(steem_instance=bts)
         ops_stream = []
         opNames = ["transfer", "vote"]
+        
         for op in b.stream(opNames=opNames, start=self.start, stop=self.stop, threading=True, thread_num=8):
             ops_stream.append(op)
+
         self.assertTrue(len(ops_stream) > 0)
         op_stat = b.ops_statistics(start=self.start, stop=self.stop)
         self.assertEqual(op_stat["vote"] + op_stat["transfer"], len(ops_stream))
         ops_blocks = []
+        last_id = self.start - 1
         for op in b.blocks(start=self.start, stop=self.stop, threading=True, thread_num=8):
             ops_blocks.append(op)
+            self.assertEqual(op.identifier, last_id + 1)
+            last_id += 1            
         op_stat4 = {"transfer": 0, "vote": 0}
         self.assertTrue(len(ops_blocks) > 0)
         for block in ops_blocks:
-- 
GitLab