mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
test for invalid vote in election pipeline
This commit is contained in:
parent
0fb4ea424b
commit
58a1a25d43
@ -36,7 +36,7 @@ class Election:
|
||||
try:
|
||||
block_id = next_vote['vote']['voting_for_block']
|
||||
node = next_vote['node_pubkey']
|
||||
except IndexError:
|
||||
except KeyError:
|
||||
return
|
||||
|
||||
next_block = self.bigchain.get_block(block_id)
|
||||
|
@ -114,6 +114,13 @@ def test_check_for_quorum_valid(b, user_pk):
|
||||
assert e.check_for_quorum(votes[-1]) is None
|
||||
|
||||
|
||||
@patch('bigchaindb.core.Bigchain.get_block')
|
||||
def test_invalid_vote(get_block, b):
|
||||
e = election.Election()
|
||||
assert e.check_for_quorum({}) is None
|
||||
get_block.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.bdb
|
||||
def test_check_requeue_transaction(b, user_pk):
|
||||
from bigchaindb.models import Transaction
|
||||
|
Loading…
x
Reference in New Issue
Block a user