Skip to content

Commit 0a793d9

Browse files
authored
Merge pull request #94 from bunq/fix_monetary_account_joint_retrieval_bunq/sdk_python#52
Fix monetary account joint retrieval #52
2 parents 7f2ac9c + c800e29 commit 0a793d9

File tree

5 files changed

+218
-4
lines changed

5 files changed

+218
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@ connectQr.png
9393
.DS_Store
9494
bunq_sdk.egg-info
9595
.idea/codeStyles/
96+
venv

bunq/sdk/model/generated/endpoint.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bunq/sdk/model/generated/object_.py

Lines changed: 68 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"id": 8948,
3+
"created": "2018-04-03 14:12:31.512599",
4+
"updated": "2018-04-03 14:12:31.512599",
5+
"alias": [
6+
{
7+
"type": "IBAN",
8+
"value": "NL19BUNQ2025192010",
9+
"name": "New User"
10+
}
11+
],
12+
"avatar": {
13+
"uuid": "063e74a4-d40b-4961-9395-0eba2d68ee01",
14+
"image": [
15+
{
16+
"attachment_public_uuid": "8a9ef272-db4a-4c1c-aac0-cc6ee2a4ebcc",
17+
"height": 1023,
18+
"width": 1024,
19+
"content_type": "image\/png"
20+
}
21+
],
22+
"anchor_uuid": "c747c366-27b7-48bd-97e6-7311dd8bcd6e"
23+
},
24+
"balance": {
25+
"currency": "EUR",
26+
"value": "0.00"
27+
},
28+
"country": "NL",
29+
"currency": "EUR",
30+
"daily_limit": {
31+
"currency": "EUR",
32+
"value": "1000.00"
33+
},
34+
"daily_spent": {
35+
"currency": "EUR",
36+
"value": "0.00"
37+
},
38+
"description": "H",
39+
"public_uuid": "c747c366-27b7-48bd-97e6-7311dd8bcd6e",
40+
"status": "PENDING_ACCEPTANCE",
41+
"sub_status": "NONE",
42+
"timezone": "europe\/amsterdam",
43+
"user_id": 7809,
44+
"monetary_account_profile": null,
45+
"notification_filters": [],
46+
"setting": {
47+
"color": "#FE2851",
48+
"default_avatar_status": "AVATAR_DEFAULT",
49+
"restriction_chat": "ALLOW_INCOMING"
50+
},
51+
"overdraft_limit": {
52+
"currency": "EUR",
53+
"value": "0.00"
54+
},
55+
"all_co_owner": [
56+
{
57+
"alias": {
58+
"uuid": "d2d59347-b5b6-4db0-8c18-9897e23a7a49",
59+
"display_name": "New",
60+
"country": "000",
61+
"avatar": {
62+
"uuid": "cb302add-2dff-4ec9-8a83-e3698809a340",
63+
"image": [
64+
{
65+
"attachment_public_uuid": "a07e6696-4800-4c5d-a30b-671cb1f3c198",
66+
"height": 128,
67+
"width": 128,
68+
"content_type": "image\/jpeg"
69+
}
70+
],
71+
"anchor_uuid": "d2d59347-b5b6-4db0-8c18-9897e23a7a49"
72+
},
73+
"public_nick_name": "New"
74+
},
75+
"status": "ACCEPTED"
76+
},
77+
{
78+
"alias": {
79+
"uuid": "fba128d6-0819-424f-b5bf-b7cd556a6438",
80+
"display_name": "Drake (Person b)",
81+
"country": "000",
82+
"avatar": {
83+
"uuid": "6e9e8e6b-b6d6-44b9-83c3-ab7150921ab1",
84+
"image": [
85+
{
86+
"attachment_public_uuid": "f3f3c3de-09f3-4523-9bfb-ab33a664610e",
87+
"height": 1024,
88+
"width": 1024,
89+
"content_type": "image\/jpeg"
90+
}
91+
],
92+
"anchor_uuid": "fba128d6-0819-424f-b5bf-b7cd556a6438"
93+
},
94+
"public_nick_name": "Drake (Person b)"
95+
},
96+
"status": "PENDING"
97+
}
98+
]
99+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import os
2+
3+
from bunq.sdk.model.generated.endpoint import MonetaryAccountJoint
4+
from tests.bunq_test import BunqSdkTestCase
5+
6+
7+
class TestMonetaryAccountJoint(BunqSdkTestCase):
8+
"""
9+
Tests:
10+
- MonetaryAccountJoint
11+
- CoOwner
12+
"""
13+
14+
_BASE_PATH_JSON_MODEL = '../../../assets/ResponseJsons'
15+
_MONETARY_ACCOUNT_JOINT_JSON = '/MonetaryAccountJoint.json'
16+
_FILE_MODE_READ = 'r'
17+
18+
@classmethod
19+
def setUpClass(cls):
20+
pass
21+
22+
def setUp(self):
23+
pass
24+
25+
def test_monetary_account_joint_parser(self):
26+
"""
27+
"""
28+
29+
base_path = os.path.dirname(__file__)
30+
file_path = os.path.abspath(
31+
os.path.join(base_path,
32+
self._BASE_PATH_JSON_MODEL +
33+
self._MONETARY_ACCOUNT_JOINT_JSON
34+
)
35+
)
36+
37+
with open(file_path, self._FILE_MODE_READ) as f:
38+
json_string = f.read()
39+
40+
joint_account: MonetaryAccountJoint = MonetaryAccountJoint.from_json(
41+
json_string
42+
)
43+
44+
self.assertIsNotNone(joint_account)
45+
self.assertIsNotNone(joint_account.all_co_owner)
46+
47+
for co_owner in joint_account.all_co_owner:
48+
self.assertIsNotNone(co_owner.alias)

0 commit comments

Comments
 (0)