mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 06:55:45 +00:00
NoneType error, fixed in test_lib.py
This commit is contained in:
parent
f65cb049e8
commit
d1dd531bcd
@ -328,13 +328,20 @@ def test_store_zero_unspent_output(b, utxo_collection):
|
||||
|
||||
@pytest.mark.bdb
|
||||
def test_store_one_unspent_output(b, unspent_output_1, utxo_collection):
|
||||
from planetmint.backend.tarantool.connection import TarantoolDB
|
||||
res = b.store_unspent_outputs(unspent_output_1)
|
||||
# assert res.acknowledged
|
||||
assert len(list(res)) == 1
|
||||
# assert utxo_collection.count_documents(
|
||||
# {'transaction_id': unspent_output_1['transaction_id'],
|
||||
# 'output_index': unspent_output_1['output_index']}
|
||||
# ) == 1
|
||||
if not isinstance(b.connection, TarantoolDB):
|
||||
assert res.acknowledged
|
||||
assert len(list(res)) == 1
|
||||
assert utxo_collection.count_documents(
|
||||
{'transaction_id': unspent_output_1['transaction_id'],
|
||||
'output_index': unspent_output_1['output_index']}
|
||||
) == 1
|
||||
else:
|
||||
utx_space = b.connection.space("utxos")
|
||||
res = utx_space.select([unspent_output_1["transaction_id"], unspent_output_1["output_index"]], index="id_search")
|
||||
assert len(res.data) == 1
|
||||
|
||||
|
||||
|
||||
@pytest.mark.bdb
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user