mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 22:45:44 +00:00
fixed further test cases
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
55aa56bf4b
commit
a7134657c6
@ -165,9 +165,9 @@ def test_upsert_validator_show(caplog, ongoing_validator_election, b):
|
|||||||
from planetmint.commands.planetmint import run_election_show
|
from planetmint.commands.planetmint import run_election_show
|
||||||
|
|
||||||
election_id = ongoing_validator_election.id
|
election_id = ongoing_validator_election.id
|
||||||
public_key = public_key_to_base64(ongoing_validator_election.asset['data']['public_key']['value'])
|
public_key = public_key_to_base64(ongoing_validator_election.assets[0]['data']['public_key']['value'])
|
||||||
power = ongoing_validator_election.asset['data']['power']
|
power = ongoing_validator_election.assets[0]['data']['power']
|
||||||
node_id = ongoing_validator_election.asset['data']['node_id']
|
node_id = ongoing_validator_election.assets[0]['data']['node_id']
|
||||||
status = ValidatorElection.ONGOING
|
status = ValidatorElection.ONGOING
|
||||||
|
|
||||||
show_args = Namespace(action='show',
|
show_args = Namespace(action='show',
|
||||||
|
|||||||
@ -30,9 +30,9 @@ def test_get_assets_tendermint(client, b, alice):
|
|||||||
assert res.status_code == 200
|
assert res.status_code == 200
|
||||||
|
|
||||||
# create asset
|
# create asset
|
||||||
asset = {'msg': 'abc'}
|
assets = [{'msg': 'abc'}]
|
||||||
tx = Create.generate([alice.public_key], [([alice.public_key], 1)],
|
tx = Create.generate([alice.public_key], [([alice.public_key], 1)],
|
||||||
assets=asset).sign([alice.private_key])
|
assets=assets).sign([alice.private_key])
|
||||||
|
|
||||||
b.store_bulk_transactions([tx])
|
b.store_bulk_transactions([tx])
|
||||||
|
|
||||||
@ -50,12 +50,12 @@ def test_get_assets_tendermint(client, b, alice):
|
|||||||
def test_get_assets_limit_tendermint(client, b, alice):
|
def test_get_assets_limit_tendermint(client, b, alice):
|
||||||
|
|
||||||
# create two assets
|
# create two assets
|
||||||
asset1 = {'msg': 'abc 1'}
|
assets1 = [{'msg': 'abc 1'}]
|
||||||
asset2 = {'msg': 'abc 2'}
|
assets2 = [{'msg': 'abc 2'}]
|
||||||
tx1 = Create.generate([alice.public_key], [([alice.public_key], 1)],
|
tx1 = Create.generate([alice.public_key], [([alice.public_key], 1)],
|
||||||
assets=asset1).sign([alice.private_key])
|
assets=assets1).sign([alice.private_key])
|
||||||
tx2 = Create.generate([alice.public_key], [([alice.public_key], 1)],
|
tx2 = Create.generate([alice.public_key], [([alice.public_key], 1)],
|
||||||
assets=asset2).sign([alice.private_key])
|
assets=assets2).sign([alice.private_key])
|
||||||
|
|
||||||
b.store_bulk_transactions([tx1])
|
b.store_bulk_transactions([tx1])
|
||||||
b.store_bulk_transactions([tx2])
|
b.store_bulk_transactions([tx2])
|
||||||
|
|||||||
@ -15,7 +15,7 @@ BLOCKS_ENDPOINT = '/api/v1/blocks/'
|
|||||||
@pytest.mark.usefixtures('inputs')
|
@pytest.mark.usefixtures('inputs')
|
||||||
def test_get_block_endpoint(b, client, alice):
|
def test_get_block_endpoint(b, client, alice):
|
||||||
import copy
|
import copy
|
||||||
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])
|
||||||
|
|
||||||
# with store_bulk_transactions we use `insert_many` where PyMongo
|
# with store_bulk_transactions we use `insert_many` where PyMongo
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user