Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Jun 15, 2018
1 parent 3c0f1cc commit 378e7bd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/beem/test_blockchain_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def setUpClass(cls):
set_shared_steem_instance(cls.bts)
cls.bts.set_default_account("test")

# b = Blockchain(steem_instance=cls.bts)
# num = b.get_current_block_num()
num = 23346630
cls.start = num - 100
b = Blockchain(steem_instance=cls.bts)
num = b.get_current_block_num()
# num = 23346630
cls.start = num - 25
cls.stop = num
cls.N_transfer = 121
cls.N_vote = 2825
# cls.N_transfer = 121
# cls.N_vote = 2825

def test_stream_threading(self):
bts = self.bts
Expand All @@ -48,10 +48,10 @@ def test_stream_threading(self):

for op in b.stream(opNames=opNames, start=self.start, stop=self.stop, threading=True, thread_num=8):
ops_stream.append(op)
self.assertEqual(self.N_transfer + self.N_vote, len(ops_stream))
# self.assertEqual(self.N_transfer + self.N_vote, len(ops_stream))

# op_stat = b.ops_statistics(start=self.start, stop=self.stop)
# self.assertEqual(op_stat["vote"] + op_stat["transfer"], len(ops_stream))
op_stat = b.ops_statistics(start=self.start, stop=self.stop, with_virtual_ops=False)
self.assertEqual(op_stat["vote"] + op_stat["transfer"], len(ops_stream))

ops_blocks = []
last_id = self.start - 1
Expand All @@ -67,5 +67,5 @@ def test_stream_threading(self):
op_stat4[op[0]] += 1
self.assertTrue(block.identifier >= self.start)
self.assertTrue(block.identifier <= self.stop)
self.assertEqual(self.N_transfer, op_stat4["transfer"])
self.assertEqual(self.N_vote, op_stat4["vote"])
self.assertEqual(op_stat["transfer"], op_stat4["transfer"])
self.assertEqual(op_stat["vote"], op_stat4["vote"])

0 comments on commit 378e7bd

Please sign in to comment.