@@ -13,9 +13,11 @@ class TestNotificationUrl(bunq_test.BunqSdkTestCase):
13
13
_GETTER_PAYMENT = 'Payment'
14
14
_GETTER_BUNQ_ME_TAB = 'BunqMeTab'
15
15
_GETTER_CHAT_MESSAGE_ANNOUNCEMENT = 'ChatMessageAnnouncement'
16
+ _GETTER_CHAT_MESSAGE = 'ChatMessage'
16
17
_GETTER_DRAFT_PAYMENT = 'DraftPayment'
17
18
_GETTER_MASTER_CARD_ACTION = 'MasterCardAction'
18
19
_GETTER_MONETARY_ACCOUNT_BANK = 'MonetaryAccountBank'
20
+ _GETTER_MONETARY_ACCOUNT = 'MonetaryAccount'
19
21
_GETTER_PAYMENT_BATCH = 'PaymentBatch'
20
22
_GETTER_REQUEST_INQUIRY = 'RequestInquiry'
21
23
_GETTER_REQUEST_RESPONSE = 'RequestResponse'
@@ -65,8 +67,12 @@ class TestNotificationUrl(bunq_test.BunqSdkTestCase):
65
67
def execute_notification_url_test (self ,
66
68
file_path ,
67
69
class_name ,
68
- getter_name ):
70
+ getter_name ,
71
+ sub_class_expected_object_name = None ,
72
+ sub_class_getter_name = None ):
69
73
"""
74
+ :type sub_class_getter_name: str
75
+ :type sub_class_expected_object_name: str
70
76
:type file_path: str
71
77
:type class_name: str
72
78
:type getter_name: str
@@ -90,6 +96,20 @@ def execute_notification_url_test(self,
90
96
)
91
97
)
92
98
99
+ if sub_class_expected_object_name is not None :
100
+ sub_class_model = getattr (referenced_model , sub_class_getter_name )
101
+
102
+ self .assertIsNotNone (sub_class_model )
103
+ self .assertTrue (
104
+ isinstance (
105
+ sub_class_model ,
106
+ self .getModelTypeOrNone (
107
+ sub_class_expected_object_name
108
+ )
109
+ )
110
+ )
111
+
112
+
93
113
@classmethod
94
114
def is_model_reference (cls , referenced_model , class_name ):
95
115
"""
@@ -163,6 +183,8 @@ def test_bunq_me_tab_model(self):
163
183
def test_chat_message_announcement_model (self ):
164
184
self .execute_notification_url_test (
165
185
self .JSON_PATH_CHAT_MESSAGE_ANNOUNCEMENT_MODEL ,
186
+ endpoint .ChatMessage .__name__ ,
187
+ self ._GETTER_CHAT_MESSAGE ,
166
188
endpoint .ChatMessageAnnouncement .__name__ ,
167
189
self ._GETTER_CHAT_MESSAGE_ANNOUNCEMENT
168
190
)
@@ -184,6 +206,8 @@ def test_mastercard_action(self):
184
206
def test_monetary_account_bank_model (self ):
185
207
self .execute_notification_url_test (
186
208
self .JSON_PATH_MONETARY_ACCOUNT_BANK_MODEL ,
209
+ endpoint .MonetaryAccount .__name__ ,
210
+ self ._GETTER_MONETARY_ACCOUNT ,
187
211
endpoint .MonetaryAccountBank .__name__ ,
188
212
self ._GETTER_MONETARY_ACCOUNT_BANK
189
213
)
0 commit comments