@@ -13,9 +13,11 @@ class TestNotificationUrl(bunq_test.BunqSdkTestCase):
1313 _GETTER_PAYMENT = 'Payment'
1414 _GETTER_BUNQ_ME_TAB = 'BunqMeTab'
1515 _GETTER_CHAT_MESSAGE_ANNOUNCEMENT = 'ChatMessageAnnouncement'
16+ _GETTER_CHAT_MESSAGE = 'ChatMessage'
1617 _GETTER_DRAFT_PAYMENT = 'DraftPayment'
1718 _GETTER_MASTER_CARD_ACTION = 'MasterCardAction'
1819 _GETTER_MONETARY_ACCOUNT_BANK = 'MonetaryAccountBank'
20+ _GETTER_MONETARY_ACCOUNT = 'MonetaryAccount'
1921 _GETTER_PAYMENT_BATCH = 'PaymentBatch'
2022 _GETTER_REQUEST_INQUIRY = 'RequestInquiry'
2123 _GETTER_REQUEST_RESPONSE = 'RequestResponse'
@@ -65,8 +67,12 @@ class TestNotificationUrl(bunq_test.BunqSdkTestCase):
6567 def execute_notification_url_test (self ,
6668 file_path ,
6769 class_name ,
68- getter_name ):
70+ getter_name ,
71+ sub_class_expected_object_name = None ,
72+ sub_class_getter_name = None ):
6973 """
74+ :type sub_class_getter_name: str
75+ :type sub_class_expected_object_name: str
7076 :type file_path: str
7177 :type class_name: str
7278 :type getter_name: str
@@ -90,6 +96,20 @@ def execute_notification_url_test(self,
9096 )
9197 )
9298
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+
93113 @classmethod
94114 def is_model_reference (cls , referenced_model , class_name ):
95115 """
@@ -163,6 +183,8 @@ def test_bunq_me_tab_model(self):
163183 def test_chat_message_announcement_model (self ):
164184 self .execute_notification_url_test (
165185 self .JSON_PATH_CHAT_MESSAGE_ANNOUNCEMENT_MODEL ,
186+ endpoint .ChatMessage .__name__ ,
187+ self ._GETTER_CHAT_MESSAGE ,
166188 endpoint .ChatMessageAnnouncement .__name__ ,
167189 self ._GETTER_CHAT_MESSAGE_ANNOUNCEMENT
168190 )
@@ -184,6 +206,8 @@ def test_mastercard_action(self):
184206 def test_monetary_account_bank_model (self ):
185207 self .execute_notification_url_test (
186208 self .JSON_PATH_MONETARY_ACCOUNT_BANK_MODEL ,
209+ endpoint .MonetaryAccount .__name__ ,
210+ self ._GETTER_MONETARY_ACCOUNT ,
187211 endpoint .MonetaryAccountBank .__name__ ,
188212 self ._GETTER_MONETARY_ACCOUNT_BANK
189213 )
0 commit comments