1
0
fin-depo/test/test_nordnet.py

25 lines
488 B
Python
Raw Normal View History

2024-06-20 21:00:22 +00:00
import pytest
2024-06-20 21:01:11 +00:00
import requests
2024-06-04 20:14:58 +00:00
2024-06-04 20:15:21 +00:00
from fin_depo import investbank_nordnet
2024-06-20 21:00:22 +00:00
from . import secrets
2024-06-04 20:14:58 +00:00
2024-06-20 21:00:22 +00:00
needs_secrets = pytest.mark.skipif(
not secrets.NORDNET_USERNAME,
reason='Secret NORDNET_USERNAME required',
)
2024-06-20 21:01:11 +00:00
2024-06-20 21:00:22 +00:00
@needs_secrets
2024-06-04 20:14:58 +00:00
def test_get_depo():
session = requests.Session()
2024-07-18 22:53:14 +00:00
fetcher = investbank_nordnet.NordnetDepoFetcher(
2024-06-04 20:15:21 +00:00
session,
2024-06-20 21:00:22 +00:00
secrets.NORDNET_USERNAME,
secrets.NORDNET_PASSWORD,
2024-06-04 20:14:58 +00:00
)
2024-07-18 22:53:14 +00:00
depo = fetcher.get_depo()
2024-06-04 20:14:58 +00:00
assert depo is not None