mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
24 lines
602 B
Python
24 lines
602 B
Python
from pytest import raises
|
|
|
|
from bigchaindb.common.exceptions import SchemaValidationError
|
|
from bigchaindb.common.schema import validate_vote_schema
|
|
|
|
|
|
def test_validate_vote():
|
|
validate_vote_schema({
|
|
'node_pubkey': 'c' * 44,
|
|
'signature': 'd' * 86,
|
|
'vote': {
|
|
'voting_for_block': 'a' * 64,
|
|
'previous_block': 'b' * 64,
|
|
'is_block_valid': False,
|
|
'invalid_reason': None,
|
|
'timestamp': '1111111111'
|
|
}
|
|
})
|
|
|
|
|
|
def test_validate_vote_fails():
|
|
with raises(SchemaValidationError):
|
|
validate_vote_schema({})
|