Compare commits
No commits in common. "a816adacbb93e9651230f4ac2795d3d280aee2ba" and "d2cdef2bfa52dcf378321e307460b282f9784d9a" have entirely different histories.
a816adacbb
...
d2cdef2bfa
|
@ -1 +1 @@
|
|||
__version__ = '0.1.12'
|
||||
__version__ = '0.1.12'
|
|
@ -1,18 +0,0 @@
|
|||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def load_secret(env_key: str) -> str:
|
||||
filepath = f'./secrets/{env_key.lower()}'
|
||||
try:
|
||||
with open(filepath) as f:
|
||||
return f.read().strip()
|
||||
logger.info('Loaded secret: %s', env_key)
|
||||
except Exception:
|
||||
logger.exception("Could not load %s file '%s'", env_key, filepath)
|
||||
return None
|
||||
|
||||
|
||||
NORDNET_USERNAME = load_secret('NORDNET_USERNAME')
|
||||
NORDNET_PASSWORD = load_secret('NORDNET_PASSWORD')
|
|
@ -1,23 +1,17 @@
|
|||
import pytest
|
||||
import requests
|
||||
|
||||
from fin_depo import investbank_nordnet
|
||||
|
||||
from . import secrets
|
||||
|
||||
needs_secrets = pytest.mark.skipif(
|
||||
not secrets.NORDNET_USERNAME,
|
||||
reason='Secret NORDNET_USERNAME required',
|
||||
)
|
||||
SECRET_USERNAME = None
|
||||
SECRET_PASSWORD = None
|
||||
|
||||
|
||||
@needs_secrets
|
||||
def test_get_depo():
|
||||
session = requests.Session()
|
||||
nordnet = investbank_nordnet.NordnetDepoFetcher(
|
||||
session,
|
||||
secrets.NORDNET_USERNAME,
|
||||
secrets.NORDNET_PASSWORD,
|
||||
SECRET_USERNAME,
|
||||
SECRET_PASSWORD,
|
||||
)
|
||||
|
||||
depo = nordnet.get_depo()
|
||||
|
|
Loading…
Reference in New Issue
Block a user