Skip to content

Commit 633f0a4

Browse files
committed
Added mortgate stuff
1 parent 0ebf702 commit 633f0a4

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "simplefin4py"
3-
version = "0.0.8"
3+
version = "0.0.9"
44
description = ""
55
authors = ["Jeef <[email protected]>"]
66
readme = "README.md"

simplefin4py/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class AccountType(Enum):
1515
CREDIT_CARD = "mdi:credit-card"
1616
SAVINGS = "mdi:piggy-bank-outline"
1717
INVESTMENT = "mdi:chart-areaspline"
18+
MORTGAGE = "mdi:home-city-outline"
1819
UNKNOWN = "mdi:cash"
1920

2021

@@ -102,14 +103,16 @@ def inferred_account_type(self) -> AccountType:
102103

103104
if "savings" in account_name_lower:
104105
return AccountType.SAVINGS
105-
106+
if "mortgate" in account_name_lower:
107+
return AccountType.MORTGAGE
106108
if "checking" in account_name_lower:
107109
return AccountType.CHECKING
108110

109111
if (
110112
"visa" in account_name_lower
111113
or "mastercard" in account_name_lower
112114
or "credit" in account_name_lower
115+
or "card" in account_name_lower
113116
):
114117
return AccountType.CREDIT_CARD
115118

tests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import json
33
import os
44
from typing import Any
5+
6+
import aiohttp
57
import pytest
68
from aioresponses import aioresponses
79

@@ -104,5 +106,10 @@ def mock_get_data_generic_error() -> Generator[aioresponses, None, None]:
104106
"""Fixture for mocking a fech process with bad credentials/url."""
105107
with aioresponses() as m:
106108
# Mock a failed login attempt due to bad credentials.
107-
m.get(MOCK_ACCESS_URL + "/accounts", status=200, body="<,asduB*J(_8asdji>")
109+
m.get(
110+
MOCK_ACCESS_URL + "/accounts",
111+
status=200,
112+
body="<,asduB*J(_8asdji>",
113+
exception=aiohttp.ClientConnectorError,
114+
)
108115
yield m

tests/fixtures/200-with-errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"url": "https://www.randombank2.com/"
159159
},
160160
"id": "ACT-7a8b9c0d-1e2f-3g4h-5i6j",
161-
"name": "Leprecon Horn",
161+
"name": "Castle Mortgage",
162162
"currency": "USD",
163163
"balance": "7500.00",
164164
"available-balance": "5000.00",

0 commit comments

Comments
 (0)