forked from square/square-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_test_base.py
More file actions
30 lines (23 loc) · 944 Bytes
/
api_test_base.py
File metadata and controls
30 lines (23 loc) · 944 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
28
29
30
# -*- coding: utf-8 -*-
import os
import unittest
from tests.http_response_catcher import HttpResponseCatcher
from square.configuration import Configuration
from square.client import Client
class ApiTestBase(unittest.TestCase):
"""All test classes inherit from this base class. It abstracts out
common functionality and configuration variables set up."""
client = None
config = None
@classmethod
def setUpClass(cls):
"""Class method called once before running tests in a test class."""
cls.request_timeout = 30
cls.assert_precision = 0.01
cls.config = ApiTestBase.create_configuration()
cls.client = Client(config=cls.config)
@staticmethod
def create_configuration():
return Configuration(access_token=os.environ['SQUARE_SANDBOX_TOKEN'],
environment='sandbox',
http_call_back=HttpResponseCatcher())