1
0
fin-depo/test/test_partisia_blockchain.py

30 lines
884 B
Python
Raw Normal View History

2024-07-18 22:53:14 +00:00
import fin_defs
import requests
2024-08-08 16:14:01 +00:00
2024-08-08 15:59:39 +00:00
import fin_depo.defi_partisia_blockchain
2024-07-18 22:53:14 +00:00
def test_get_depo():
session = requests.Session()
2024-07-21 09:09:49 +00:00
fetcher = fin_depo.defi_partisia_blockchain.PartisiaBlockchainAccountDepoFetcher(
2024-07-18 22:53:14 +00:00
session,
'00f3a778fbcf663e4f0d47b41aa4ec51e0f9d39d60',
)
depo = fetcher.get_depo()
2024-07-21 09:09:49 +00:00
# Check layout
assert isinstance(depo, fin_depo.data.DepoGroup)
2024-07-18 22:53:14 +00:00
assert depo.name == 'Partisia Blockchain'
assert depo.updated_time is not None
2024-07-21 09:09:49 +00:00
assert isinstance(depo.nested[0], fin_depo.data.DepoSingle)
2024-07-18 22:53:14 +00:00
assert depo.nested[0].name == 'Native'
assert depo.nested[0].updated_time == depo.updated_time
2024-07-21 09:09:49 +00:00
assert isinstance(depo.nested[0], fin_depo.data.DepoSingle)
2024-07-18 22:53:14 +00:00
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)