Skip to content

Commit

Permalink
Problem: Transaction schema tests were disabled. (#2404)
Browse files Browse the repository at this point in the history
Solution: Re-enable the tests. Remove some no longer relevant parts.
  • Loading branch information
ldmberman authored and kansi committed Jul 26, 2018
1 parent af2bf61 commit 2f6413f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 49 deletions.
50 changes: 1 addition & 49 deletions tests/common/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
USER3_PRIVATE_KEY = '4rNQFzWQbVwuTiDVxwuFMvLG5zd8AhrQKCtVovBvcYsB'
USER3_PUBLIC_KEY = 'Gbrg7JtxdjedQRmr81ZZbh1BozS7fBW88ZyxNDy7WLNC'


CC_FULFILLMENT_URI = (
'pGSAINdamAGCsQq31Uv-08lkBzoO4XLz2qYjJa8CGmj3B1EagUDlVkMAw2CscpCG4syAboKKh'
'Id_Hrjl2XTYc-BlIkkBVV-4ghWQozusxh45cBz5tGvSW_XwWVu-JGVRQUOOehAL'
Expand All @@ -26,10 +25,6 @@
}
}

ASSET_LINK = {
'id': 'a' * 64
}

DATA = {
'msg': 'Hello BigchainDB!'
}
Expand Down Expand Up @@ -104,12 +99,6 @@ def user_input(user_Ed25519, user_pub):
return Input(user_Ed25519, [user_pub])


@pytest.fixture
def user2_input(user2_Ed25519, user2_pub):
from bigchaindb.common.transaction import Input
return Input(user2_Ed25519, [user2_pub])


@pytest.fixture
def user_user2_threshold_output(user_user2_threshold, user_pub, user2_pub):
from bigchaindb.common.transaction import Output
Expand Down Expand Up @@ -139,11 +128,6 @@ def asset_definition():
return ASSET_DEFINITION


@pytest.fixture
def asset_link():
return ASSET_LINK


@pytest.fixture
def data():
return DATA
Expand Down Expand Up @@ -200,7 +184,7 @@ def dummy_transaction():
},
'public_keys': [58 * 'b']
}],
'version': '1.0'
'version': '2.0'
}


Expand Down Expand Up @@ -271,38 +255,6 @@ def fulfilled_transaction():
}


@pytest.fixture
def fulfilled_and_hashed_transaction():
return {
'asset': {
'data': {
'msg': 'Hello BigchainDB!',
}
},
'id': '7a7c827cf4ef7985f08f4e9d16f5ffc58ca4e82271921dfbed32e70cb462485f',
'inputs': [{
'fulfillment': ('pGSAIP_2P1Juh-94sD3uno1lxMPd9EkIalRo7QB014pT6dD9g'
'UANRNxasDy1Dfg9C2Fk4UgHdYFsJzItVYi5JJ_vWc6rKltn0k'
'jagynI0xfyR6X9NhzccTt5oiNH9mThEb4QmagN'),
'fulfills': None,
'owners_before': ['JEAkEJqLbbgDRAtMm8YAjGp759Aq2qTn9eaEHUj2XePE']
}],
'metadata': None,
'operation': 'CREATE',
'outputs': [{
'amount': '1',
'condition': {
'details': {
'public_key': 'JEAkEJqLbbgDRAtMm8YAjGp759Aq2qTn9eaEHUj2XePE',
'type': 'ed25519-sha-256'
},
'uri': 'ni:///sha-256;49C5UWNODwtcINxLgLc90bMCFqCymFYONGEmV4a0sG4?fpt=ed25519-sha-256&cost=131072'},
'public_keys': ['JEAkEJqLbbgDRAtMm8YAjGp759Aq2qTn9eaEHUj2XePE']
}],
'version': '1.0'
}


# TODO For reviewers: Pick which approach you like best: parametrized or not?
@pytest.fixture(params=(
{'id': None,
Expand Down
6 changes: 6 additions & 0 deletions tests/common/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from unittest.mock import patch

import pytest

from hypothesis import given
from hypothesis_regex import regex
from pytest import raises
Expand All @@ -19,9 +21,13 @@
'preimage-sha-256', 'prefix-sha-256', 'rsa-sha-256')


pytestmark = pytest.mark.tendermint


################################################################################
# Test of schema utils


def _test_additionalproperties(node, path=''):
"""Validate that each object node has additionalProperties set, so that
objects with junk keys do not pass as valid.
Expand Down

0 comments on commit 2f6413f

Please sign in to comment.