From 71bbc4fe4f9715214a535f250c5d2c1ca85e0114 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 29 Apr 2016 16:15:41 +0200 Subject: [PATCH] test block liquidation --- tests/db/test_voter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/db/test_voter.py b/tests/db/test_voter.py index 8180c133..6b86bdd4 100644 --- a/tests/db/test_voter.py +++ b/tests/db/test_voter.py @@ -330,7 +330,6 @@ class TestBlockElection(object): def test_tx_rewritten_after_invalid(self, b, user_public_key): q_block_new_vote = mp.Queue() - election = Election(q_block_new_vote) # create blocks with transactions tx1 = b.create_transaction(b.me, user_public_key, None, 'CREATE') @@ -357,11 +356,17 @@ class TestBlockElection(object): test_block_2['block']['votes'] = [invalid_vote_2, invalid_vote_2, valid_vote_2, valid_vote_2] q_block_new_vote.put(test_block_2) + election = Election(q_block_new_vote) election.start() time.sleep(1) election.kill() - # TEST GOES HERE?? + # tx1 was in a valid block, and should not be in the backlog + assert r.table('backlog').get(tx1['id']).run(b.conn) is None + + # tx2 was in an invalid block and SHOULD be in the backlog + assert r.table('backlog').get(tx2['id']).run(b.conn)['id'] == tx2['id'] + class TestBlockStream(object):