Skip to content

Commit

Permalink
[tst] unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
grindsa committed Jan 9, 2025
1 parent 29c9542 commit 2901b76
Show file tree
Hide file tree
Showing 3 changed files with 461 additions and 9 deletions.
9 changes: 4 additions & 5 deletions dkb_robo/portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
from dataclasses import dataclass, asdict
import logging
import requests
from dkb_robo.utilities import Amount, Person, get_dateformat, filter_unexpected_fields
from dkb_robo.utilities import Amount, Person, get_dateformat, filter_unexpected_fields, BASE_URL

LEGACY_DATE_FORMAT, API_DATE_FORMAT = get_dateformat()
BASE_URL = 'https://banking.dkb.de/api'
logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -101,7 +100,7 @@ def _sort(self, portfolio_dic: Dict[str, str]) -> Dict[str, str]:

data_dic = self._itemize(portfolio_dic)

display_settings_dic = portfolio_dic.get('product_display', {}).get('data', {})
display_settings_dic = portfolio_dic .get('product_display', {}).get('data', {})
productgroup = ProductGroup()
for portfolio in display_settings_dic:
# get id/name mapping and productlist per group
Expand Down Expand Up @@ -254,10 +253,10 @@ def __post_init__(self):
try:
self.minimumAmount = float(self.minimumAmount)
except Exception:
self.maximumAmount = None
self.minimumAmount = None
if self.maximumAmount:
try:
self.maximumAmount = float(self.minimumAmount)
self.maximumAmount = float(self.maximumAmount)
except Exception:
self.maximumAmount = None

Expand Down
1 change: 1 addition & 0 deletions dkb_robo/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def get_dateformat():

LEGACY_DATE_FORMAT, API_DATE_FORMAT = get_dateformat()
JSON_CONTENT_TYPE = 'application/vnd.api+json'
BASE_URL = 'https://banking.dkb.de/api'


def filter_unexpected_fields(cls):
Expand Down
Loading

0 comments on commit 2901b76

Please sign in to comment.