mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
basic tests for vote schema validator
This commit is contained in:
parent
bfb5be3ba4
commit
f38028d727
@ -0,0 +1,23 @@
|
|||||||
|
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({})
|
Loading…
x
Reference in New Issue
Block a user