mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Fix tests
This commit is contained in:
parent
2a820b46f3
commit
49fca5cf3f
@ -26,6 +26,7 @@ def inputs(user_pk):
|
|||||||
@pytest.mark.usefixtures('processes')
|
@pytest.mark.usefixtures('processes')
|
||||||
def test_fast_double_create(b, user_pk):
|
def test_fast_double_create(b, user_pk):
|
||||||
from bigchaindb.models import Transaction
|
from bigchaindb.models import Transaction
|
||||||
|
from bigchaindb.backend.query import count_blocks
|
||||||
tx = Transaction.create([b.me], [([user_pk], 1)],
|
tx = Transaction.create([b.me], [([user_pk], 1)],
|
||||||
metadata={'test': 'test'}) \
|
metadata={'test': 'test'}) \
|
||||||
.sign([b.me_private])
|
.sign([b.me_private])
|
||||||
@ -42,12 +43,13 @@ def test_fast_double_create(b, user_pk):
|
|||||||
# test the transaction appears only once
|
# test the transaction appears only once
|
||||||
last_voted_block = b.get_last_voted_block()
|
last_voted_block = b.get_last_voted_block()
|
||||||
assert len(last_voted_block.transactions) == 1
|
assert len(last_voted_block.transactions) == 1
|
||||||
assert b.backend.count_blocks() == 2
|
assert count_blocks(b.connection) == 2
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures('processes')
|
@pytest.mark.usefixtures('processes')
|
||||||
def test_double_create(b, user_pk):
|
def test_double_create(b, user_pk):
|
||||||
from bigchaindb.models import Transaction
|
from bigchaindb.models import Transaction
|
||||||
|
from bigchaindb.backend.query import count_blocks
|
||||||
tx = Transaction.create([b.me], [([user_pk], 1)],
|
tx = Transaction.create([b.me], [([user_pk], 1)],
|
||||||
metadata={'test': 'test'}) \
|
metadata={'test': 'test'}) \
|
||||||
.sign([b.me_private])
|
.sign([b.me_private])
|
||||||
@ -63,4 +65,4 @@ def test_double_create(b, user_pk):
|
|||||||
# test the transaction appears only once
|
# test the transaction appears only once
|
||||||
last_voted_block = b.get_last_voted_block()
|
last_voted_block = b.get_last_voted_block()
|
||||||
assert len(last_voted_block.transactions) == 1
|
assert len(last_voted_block.transactions) == 1
|
||||||
assert b.backend.count_blocks() == 2
|
assert count_blocks(b.connection) == 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user