forked from square/square-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_labor_api.py
More file actions
70 lines (50 loc) · 2.31 KB
/
test_labor_api.py
File metadata and controls
70 lines (50 loc) · 2.31 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -*- coding: utf-8 -*-
from tests.test_helper import TestHelper
from tests.api.api_test_base import ApiTestBase
class LaborApiTests(ApiTestBase):
@classmethod
def setUpClass(cls):
super(LaborApiTests, cls).setUpClass()
cls.controller = cls.client.labor
cls.response_catcher = cls.controller.http_call_back
# Returns a paginated list of `BreakType` instances for a business.
def test_list_break_types(self):
# Parameters for the API call
location_id = None
limit = None
cursor = None
# Perform the API call through the SDK function
result = self.controller.list_break_types(location_id, limit, cursor)
# 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))
# Returns a paginated list of `EmployeeWage` instances for a business.
def test_list_employee_wages(self):
# Parameters for the API call
employee_id = None
limit = None
cursor = None
# Perform the API call through the SDK function
result = self.controller.list_employee_wages(employee_id, limit, cursor)
# 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))
# Returns a list of `WorkweekConfig` instances for a business.
def test_list_workweek_configs(self):
# Parameters for the API call
limit = None
cursor = None
# Perform the API call through the SDK function
result = self.controller.list_workweek_configs(limit, cursor)
# 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))