mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
fixed some more tests
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
a7134657c6
commit
cd48ebcab4
@ -182,7 +182,7 @@ def test_store_transaction(mocker, b, signed_create_tx,
|
|||||||
|
|
||||||
mocked_store_asset.assert_called_once_with(
|
mocked_store_asset.assert_called_once_with(
|
||||||
b.connection,
|
b.connection,
|
||||||
[{'id': signed_create_tx.id, 'data': signed_create_tx.asset['data']}],
|
[{'id': signed_create_tx.id, 'data': signed_create_tx.assets[0]['data']}],
|
||||||
)
|
)
|
||||||
mocked_store_metadata.assert_called_once_with(
|
mocked_store_metadata.assert_called_once_with(
|
||||||
b.connection,
|
b.connection,
|
||||||
@ -231,7 +231,7 @@ def test_store_bulk_transaction(mocker, b, signed_create_tx,
|
|||||||
# assert utxo['output_index'] == 0
|
# assert utxo['output_index'] == 0
|
||||||
mocked_store_assets.assert_called_once_with(
|
mocked_store_assets.assert_called_once_with(
|
||||||
b.connection,
|
b.connection,
|
||||||
[{'id': signed_create_tx.id, 'data': signed_create_tx.asset['data']}],
|
[{'id': signed_create_tx.id, 'data': signed_create_tx.assets[0]['data']}],
|
||||||
)
|
)
|
||||||
mocked_store_metadata.assert_called_once_with(
|
mocked_store_metadata.assert_called_once_with(
|
||||||
b.connection,
|
b.connection,
|
||||||
|
|||||||
@ -48,7 +48,7 @@ def test_get_block_returns_404_if_not_found(client):
|
|||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
def test_get_block_containing_transaction(b, client, alice):
|
def test_get_block_containing_transaction(b, client, alice):
|
||||||
tx = Create.generate([alice.public_key], [([alice.public_key], 1)], assets={'cycle': 'hero'})
|
tx = Create.generate([alice.public_key], [([alice.public_key], 1)], assets=[{'cycle': 'hero'}])
|
||||||
tx = tx.sign([alice.private_key])
|
tx = tx.sign([alice.private_key])
|
||||||
b.store_bulk_transactions([tx])
|
b.store_bulk_transactions([tx])
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,10 @@ def test_get_metadata_tendermint(client, b, alice):
|
|||||||
assert res.status_code == 200
|
assert res.status_code == 200
|
||||||
|
|
||||||
# create asset
|
# create asset
|
||||||
asset = {'msg': 'abc'}
|
assets = [{'msg': 'abc'}]
|
||||||
metadata = {'key': 'my_meta'}
|
metadata = {'key': 'my_meta'}
|
||||||
tx = Create.generate([alice.public_key], [([alice.public_key], 1)], metadata=metadata,
|
tx = Create.generate([alice.public_key], [([alice.public_key], 1)], metadata=metadata,
|
||||||
assets=asset).sign([alice.private_key])
|
assets=assets).sign([alice.private_key])
|
||||||
|
|
||||||
b.store_bulk_transactions([tx])
|
b.store_bulk_transactions([tx])
|
||||||
|
|
||||||
@ -51,16 +51,16 @@ def test_get_metadata_tendermint(client, b, alice):
|
|||||||
def test_get_metadata_limit_tendermint(client, b, alice):
|
def test_get_metadata_limit_tendermint(client, b, alice):
|
||||||
|
|
||||||
# create two assets
|
# create two assets
|
||||||
asset1 = {'msg': 'abc 1'}
|
assets1 = [{'msg': 'abc 1'}]
|
||||||
meta1 = {'key': 'meta 1'}
|
meta1 = {'key': 'meta 1'}
|
||||||
tx1 = Create.generate([alice.public_key], [([alice.public_key], 1)], metadata=meta1,
|
tx1 = Create.generate([alice.public_key], [([alice.public_key], 1)], metadata=meta1,
|
||||||
assets=asset1).sign([alice.private_key])
|
assets=assets1).sign([alice.private_key])
|
||||||
b.store_bulk_transactions([tx1])
|
b.store_bulk_transactions([tx1])
|
||||||
|
|
||||||
asset2 = {'msg': 'abc 2'}
|
assets2 = [{'msg': 'abc 2'}]
|
||||||
meta2 = {'key': 'meta 2'}
|
meta2 = {'key': 'meta 2'}
|
||||||
tx2 = Create.generate([alice.public_key], [([alice.public_key], 1)], metadata=meta2,
|
tx2 = Create.generate([alice.public_key], [([alice.public_key], 1)], metadata=meta2,
|
||||||
assets=asset2).sign([alice.private_key])
|
assets=assets2).sign([alice.private_key])
|
||||||
b.store_bulk_transactions([tx2])
|
b.store_bulk_transactions([tx2])
|
||||||
|
|
||||||
# test that both assets are returned without limit
|
# test that both assets are returned without limit
|
||||||
|
|||||||
@ -47,7 +47,7 @@ def test_eventify_block_works_with_any_transaction():
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'height': 1,
|
'height': 1,
|
||||||
'asset_id': tx_transfer.asset['id'],
|
'asset_id': tx_transfer.assets[0]['id'],
|
||||||
'transaction_id': tx_transfer.id
|
'transaction_id': tx_transfer.id
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user