@@ -21,7 +21,8 @@ class TestPayment(BunqSdkTestCase):
2121 _PAYMENT_CURRENCY = 'EUR'
2222 _PAYMENT_DESCRIPTION = 'Python unit test'
2323 _PAYMENT_CHAT_TEXT_MESSAGE = 'send from python test'
24- _USER_ID = Config .get_user_id ()
24+
25+ _MAXIMUM_PAYMENT_IN_BATCH = 10
2526
2627 def test_payment_to_other_user (self ):
2728 """
@@ -31,8 +32,8 @@ def test_payment_to_other_user(self):
3132 without errors
3233 """
3334
34- Payment .create (
35- Amount (self ._PAYMENT_AMOUNT_EUR , self ._PAYMENT_CURRENCY ),
35+ endpoint . Payment .create (
36+ object_ . Amount (self ._PAYMENT_AMOUNT_EUR , self ._PAYMENT_CURRENCY ),
3637 self ._get_pointer_bravo (),
3738 self ._PAYMENT_DESCRIPTION
3839 )
@@ -45,8 +46,8 @@ def test_payment_to_other_account(self):
4546 without errors
4647 """
4748
48- Payment .create (
49- Amount (self ._PAYMENT_AMOUNT_EUR , self ._PAYMENT_CURRENCY ),
49+ endpoint . Payment .create (
50+ object_ . Amount (self ._PAYMENT_AMOUNT_EUR , self ._PAYMENT_CURRENCY ),
5051 self ._get_alias_second_account (),
5152 self ._PAYMENT_DESCRIPTION
5253 )
@@ -59,43 +60,46 @@ def test_payment_chat(self):
5960 without errors
6061 """
6162
62- payment_id = Payment .create (
63- Amount (self ._PAYMENT_AMOUNT_EUR , self ._PAYMENT_CURRENCY ),
63+ payment_id = endpoint . Payment .create (
64+ object_ . Amount (self ._PAYMENT_AMOUNT_EUR , self ._PAYMENT_CURRENCY ),
6465 self ._get_pointer_bravo (),
6566 self ._PAYMENT_DESCRIPTION
6667 ).value
6768
68- chat_id = PaymentChat .create (payment_id ).value
69+ chat_id = endpoint . PaymentChat .create (payment_id ).value
6970
70- ChatMessageText .create (chat_id , self ._PAYMENT_CHAT_TEXT_MESSAGE )
71+ endpoint . ChatMessageText .create (chat_id , self ._PAYMENT_CHAT_TEXT_MESSAGE )
7172
7273 def test_payment_batch (self ):
73- response_create : BunqResponseInt = PaymentBatch .create (
74- self .__create_payment_list ()
75- )
74+ response_create : endpoint .BunqResponseInt = \
75+ endpoint .PaymentBatch .create (
76+ self .__create_payment_list ()
77+ )
7678
7779 self .assertIsNotNone (response_create )
7880
79- response_get : BunqResponsePaymentBatch = \
80- PaymentBatch .get (response_create .value )
81+ response_get : endpoint . BunqResponsePaymentBatch = \
82+ endpoint . PaymentBatch .get (response_create .value )
8183
8284 self .assertIsNotNone (response_get )
8385 self .assertFalse (response_get .value .is_all_field_none ())
8486
85- @staticmethod
86- def __create_payment_list () -> List [Payment ]:
87+ def __create_payment_list (self ) -> List [endpoint .Payment ]:
8788 """
8889 :rtype: List[Payment]
8990 """
9091
91- all_payment : List [Payment ] = []
92+ all_payment : List [endpoint . Payment ] = []
9293
93- while len (all_payment ) < 10 :
94+ while len (all_payment ) < self . _MAXIMUM_PAYMENT_IN_BATCH :
9495 all_payment .append (
95- Payment (
96- Amount ('0.01' , 'EUR' ),
97- Pointer ('EMAIL' , 'bravo@bunq.com' ),
98- 'Python sdk payment batch test.'
96+ endpoint .Payment (
97+ object_ .Amount (
98+ self ._PAYMENT_AMOUNT_EUR ,
99+ self ._PAYMENT_CURRENCY
100+ ),
101+ object_ .Pointer (self ._POINTER_EMAIL , self ._EMAIL_BRAVO ),
102+ self ._PAYMENT_DESCRIPTION
99103 )
100104 )
101105
0 commit comments