import pytest import requests import fin_depo from . import secrets needs_secrets = pytest.mark.skipif( not secrets.NORDNET_USERNAME, reason='Secret NORDNET_USERNAME required', ) def print_pretty(depo: fin_depo.data.Depo): for asset in depo.assets(): amount = depo.get_amount_of_asset(asset) print(f'{str(asset):15} : {amount:10}') del asset, amount @needs_secrets def test_get_depo(): session = requests.Session() fetcher = fin_depo.investbank_nordnet.NordnetDepoFetcher( session, secrets.NORDNET_USERNAME, secrets.NORDNET_PASSWORD, ) depo = fetcher.get_depo() print_pretty(depo) assert isinstance(depo, fin_depo.data.DepoGroup)