1
0

Test partisia blockchain

This commit is contained in:
Jon Michael Aanes 2024-07-19 00:53:14 +02:00
parent ef417c6175
commit e993acf3af
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
3 changed files with 26 additions and 3 deletions

View File

@ -166,7 +166,7 @@ class PartisiaBlockchainAccountDepoFetcher(DepoFetcher):
{fin_defs.MPC: balances.mpc},
)
depo_byoc = DepoSingle(
'BYOC',
'Bring Your Own Coin',
balances.update_time,
{BYOC_ASSETS[k]: v for k, v in balances.byoc.items()},
)

View File

@ -14,11 +14,11 @@ needs_secrets = pytest.mark.skipif(
@needs_secrets
def test_get_depo():
session = requests.Session()
nordnet = investbank_nordnet.NordnetDepoFetcher(
fetcher = investbank_nordnet.NordnetDepoFetcher(
session,
secrets.NORDNET_USERNAME,
secrets.NORDNET_PASSWORD,
)
depo = nordnet.get_depo()
depo = fetcher.get_depo()
assert depo is not None

View File

@ -0,0 +1,23 @@
import fin_defs
import requests
from fin_depo import defi_partisia_blockchain
def test_get_depo():
session = requests.Session()
fetcher = defi_partisia_blockchain.PartisiaBlockchainAccountDepoFetcher(
session,
'00f3a778fbcf663e4f0d47b41aa4ec51e0f9d39d60',
)
depo = fetcher.get_depo()
assert depo is not None
assert depo.name == 'Partisia Blockchain'
assert depo.updated_time is not None
assert depo.nested[0].name == 'Native'
assert depo.nested[0].updated_time == depo.updated_time
assert depo.nested[1].name == 'Bring Your Own Coin'
assert depo.nested[1].updated_time == depo.updated_time
assert depo.get_amount_of_asset(fin_defs.MPC)