forked from andela-sjames/paystack-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_trecipient.py
More file actions
41 lines (34 loc) · 1.25 KB
/
test_trecipient.py
File metadata and controls
41 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.trecipient import TransferRecipient
class TestSubAccount(BaseTestCase):
@httpretty.activate
def test_create_trecipient(self):
"""Method defined to test trecipient creation."""
httpretty.register_uri(
httpretty.POST,
self.endpoint_url("/transferrecipient"),
content_type='text/json',
body='{"status": true, "message": "Recipient created"}',
status=201,
)
response = TransferRecipient.create(
type="nuban",
name="Zombie",
description="Zombier",
account_number="01000000010",
bank_code="044",
)
self.assertTrue(response['status'])
@httpretty.activate
def test_list_trecipient(self):
"""Method defined to test trecipient list."""
httpretty.register_uri(
httpretty.GET,
self.endpoint_url("/transferrecipient"),
content_type='text/json',
body='{"status": true, "message": "Recipient retrieved"}',
status=201,
)
response = TransferRecipient.list(perPage=3, page=1)
self.assertEqual(response['status'], True)