forked from square/square-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_refunds_api.py
More file actions
37 lines (29 loc) · 1.24 KB
/
test_refunds_api.py
File metadata and controls
37 lines (29 loc) · 1.24 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
# -*- coding: utf-8 -*-
from tests.test_helper import TestHelper
from tests.api.api_test_base import ApiTestBase
class RefundsApiTests(ApiTestBase):
@classmethod
def setUpClass(cls):
super(RefundsApiTests, cls).setUpClass()
cls.controller = cls.client.refunds
cls.response_catcher = cls.controller.http_call_back
# Retrieves a list of refunds for the account making the request.
#
#Max results per page: 100
def test_test_list_payment_refunds(self):
# Parameters for the API call
begin_time = None
end_time = None
sort_order = None
cursor = None
location_id = None
status = None
source_type = None
# Perform the API call through the SDK function
result = self.controller.list_payment_refunds(begin_time, end_time, sort_order, cursor, location_id, status, source_type)
# 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))