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()
|
|
|
|
nordnet = 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
|
|
|
)
|
|
|
|
|
|
|
|
depo = nordnet.get_depo()
|
|
|
|
assert depo is not None
|