From 7f5318cba43a1cbffe63280fe04ee1b9840fe816 Mon Sep 17 00:00:00 2001 From: Scott Sadler Date: Wed, 1 Feb 2017 14:33:53 +0100 Subject: [PATCH] check validate_transaction raises DoubleSpend in integration test --- tests/integration/test_integration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index ceb18b04..6597a0e7 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -49,6 +49,7 @@ def test_double_create(b, user_pk): @pytest.mark.usefixtures('inputs') def test_get_owned_ids_works_after_double_spend(b, user_pk, user_sk): """ Test for #633 https://github.com/bigchaindb/bigchaindb/issues/633 """ + from bigchaindb.common.exceptions import DoubleSpend from bigchaindb.models import Transaction input_valid = b.get_owned_ids(user_pk).pop() input_valid = b.get_transaction(input_valid.txid) @@ -76,4 +77,5 @@ def test_get_owned_ids_works_after_double_spend(b, user_pk, user_sk): # still doesn't throw an exception b.get_owned_ids(user_pk) - assert b.is_valid_transaction(tx_double_spend) is False + with pytest.raises(DoubleSpend): + b.validate_transaction(tx_double_spend)