forked from square/square-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_payments_api.py
More file actions
38 lines (30 loc) · 1.26 KB
/
test_payments_api.py
File metadata and controls
38 lines (30 loc) · 1.26 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
# -*- coding: utf-8 -*-
from tests.test_helper import TestHelper
from tests.api.api_test_base import ApiTestBase
class PaymentsApiTests(ApiTestBase):
@classmethod
def setUpClass(cls):
super(PaymentsApiTests, cls).setUpClass()
cls.controller = cls.client.payments
cls.response_catcher = cls.controller.http_call_back
# Retrieves a list of payments taken by the account making the request.
#
#Max results per page: 100
def test_test_list_payments(self):
# Parameters for the API call
begin_time = None
end_time = None
sort_order = None
cursor = None
location_id = None
total = None
last_4 = None
card_brand = None
# Perform the API call through the SDK function
result = self.controller.list_payments(begin_time, end_time, sort_order, cursor, location_id, total, last_4, card_brand)
# Test response code
self.assertEquals(self.response_catcher.response.status_code, 200)
# Test headers
expected_headers = {}
expected_headers['content-type'] = 'application/json'
self.assertTrue(TestHelper.match_headers(expected_headers, self.response_catcher.response.headers))