forked from andela-sjames/paystack-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_paystack.py
More file actions
27 lines (20 loc) · 831 Bytes
/
test_paystack.py
File metadata and controls
27 lines (20 loc) · 831 Bytes
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
"""Script defined to test the paystack class."""
import httpretty
from paystackapi.paystack import Paystack
from paystackapi.tests.base_test_case import BaseTestCase
paystack_secret_key = "sk_test_0a246ef179dc841f42d20959bebdd790f69605d8"
paystack = Paystack(secret_key=paystack_secret_key)
class TestPaystackClass(BaseTestCase):
"""Method defined to test paystack class."""
@httpretty.activate
def test_transaction_init(self):
"""Method defined to test dynamic class use."""
httpretty.register_uri(
httpretty.GET,
self.endpoint_url("/transaction"),
content_type='text/json',
body='{"status": true, "contributors": true}',
status=201,
)
response = paystack.transaction.list()
self.assertTrue(response['status'])