Skip to content

Commit

Permalink
Improved unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Jun 15, 2018
1 parent 378e7bd commit 7cde7c4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/beem/test_blockchain_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,17 @@ def test_stream_threading(self):
self.assertTrue(len(ops_blocks) > 0)
for block in ops_blocks:
for op in block.operations:
if op[0] in opNames:
op_stat4[op[0]] += 1
if isinstance(op, dict) and 'type' in op:
op_type = op["type"]
if len(op_type) > 10 and op_type[len(op_type) - 10:] == "_operation":
op_type = op_type[:-10]
else:
if "op" in op:
op_type = op["op"][0]
else:
op_type = op[0]
if op_type in opNames:
op_stat4[op_type] += 1
self.assertTrue(block.identifier >= self.start)
self.assertTrue(block.identifier <= self.stop)
self.assertEqual(op_stat["transfer"], op_stat4["transfer"])
Expand Down

0 comments on commit 7cde7c4

Please sign in to comment.