Skip to content

Commit 61654ad

Browse files
authored
Merge pull request #35 from ebastos/main
Isolate responsibilities
2 parents 46e5f65 + 617b93c commit 61654ad

5 files changed

Lines changed: 399 additions & 320 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "ws-api"
7-
version = "0.29.2"
7+
version = "0.29.3"
88
description = "Access your Wealthsimple account using their (GraphQL) API."
99
readme = "README.md"
1010
license = {file = "LICENSE"}

tests/test_wealthsimple_api_happy.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44

55
from ws_api.exceptions import WSApiException
6+
from ws_api.formatters import format_account_description
67
from ws_api.session import WSAPISession
78
from ws_api.wealthsimple_api import WealthsimpleAPI, WealthsimpleAPIBase
89

@@ -155,7 +156,7 @@ def test_account_add_description(api, unified_type, expected_desc):
155156
"accountFeatures": [],
156157
"custodianAccounts": [],
157158
}
158-
api._account_add_description(account)
159+
format_account_description(account)
159160
assert account["description"] == expected_desc
160161

161162

@@ -169,7 +170,7 @@ def test_account_add_description_cash(api):
169170
"accountFeatures": [],
170171
"custodianAccounts": [{"branch": "WS", "id": "cust123", "status": "open"}],
171172
}
172-
api._account_add_description(account)
173+
format_account_description(account)
173174
assert account["description"] == "Cash"
174175
assert account["number"] == "cust123"
175176

@@ -183,7 +184,7 @@ def test_account_add_description_cash_joint(api):
183184
"accountFeatures": [],
184185
"custodianAccounts": [],
185186
}
186-
api._account_add_description(account)
187+
format_account_description(account)
187188
assert account["description"] == "Cash: joint"
188189

189190

@@ -196,7 +197,7 @@ def test_account_add_description_managed_private_credit(api):
196197
"accountFeatures": [{"name": "PRIVATE_CREDIT"}],
197198
"custodianAccounts": [],
198199
}
199-
api._account_add_description(account)
200+
format_account_description(account)
200201
assert account["description"] == "Non-registered: managed - private credit"
201202

202203

@@ -209,7 +210,7 @@ def test_account_add_description_managed_private_equity(api):
209210
"accountFeatures": [{"name": "PRIVATE_EQUITY"}],
210211
"custodianAccounts": [],
211212
}
212-
api._account_add_description(account)
213+
format_account_description(account)
213214
assert account["description"] == "Non-registered: managed - private equity"
214215

215216

@@ -223,7 +224,7 @@ def test_account_add_description_nickname_override(api):
223224
"accountFeatures": [],
224225
"custodianAccounts": [],
225226
}
226-
api._account_add_description(account)
227+
format_account_description(account)
227228
assert account["description"] == "My Retirement Fund"
228229

229230

@@ -236,7 +237,7 @@ def test_account_add_description_unknown_type_fallback(api):
236237
"accountFeatures": [],
237238
"custodianAccounts": [],
238239
}
239-
api._account_add_description(account)
240+
format_account_description(account)
240241
assert account["description"] == "SOME_FUTURE_TYPE"
241242

242243

0 commit comments

Comments
 (0)