Skip to content

Commit b8e9652

Browse files
committed
Update client tests
1 parent 0819963 commit b8e9652

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

samples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import os
55
from synapse_pay_rest import Client
66

77
required = {
8-
'client_id': os.environ['CLIENT_ID'], # your client id
9-
'client_secret': os.environ['CLIENT_SECRET'], # your client secret
8+
'client_id': os.environ['TEST_CLIENT_ID'], # your client id
9+
'client_secret': os.environ['TEST_CLIENT_SECRET'], # your client secret
1010
'fingerprint': 'user_fingerprint',
1111
'ip_address': '127.0.0.1', # user's IP
1212
}

synapse_pay_rest/tests/client_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_properties(self):
2626
self.assertIsInstance(self.client.trans, Trans)
2727

2828
def test_passes_correct_base_url_to_http_client(self):
29-
sandbox = 'https://sandbox.synapsepay.com/api/3'
29+
sandbox = 'https://uat-api.synapsefi.com/v3.1'
3030
production = 'https://synapsepay.com/api/3'
3131
self.assertEqual(sandbox, self.client.http_client.base_url)
3232

synapse_pay_rest/tests/errors_tests.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,22 @@ def setUp(self):
88
print('\n{0}.{1}'.format(type(self).__name__, self._testMethodName))
99
self.client = test_client
1010

11-
def test_404_error(self):
11+
# TODO. Build an actual Response object manually?
12+
# def test_400_error(self):
13+
# response = {
14+
# 'error': {
15+
# 'en': "Unable to verify document information. Please submit a valid copy of passport/driver's license."
16+
# },
17+
# 'error_code': '400',
18+
# 'http_code': '409',
19+
# 'success': False
20+
# }
21+
# error = ErrorFactory.from_response(response)
22+
# self.assertEqual(response['error']['en'], error.message)
23+
# self.assertEqual(response['error_code'], error.code)
24+
# self.assertIsInstance(error, NotFoundError)
25+
26+
def test_not_found_error(self):
1227
user_id = '11111111111111'
1328
with self.assertRaises(NotFoundError):
1429
self.client.users.get(user_id)

synapse_pay_rest/tests/fixtures/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22
from synapse_pay_rest.client import Client
33

4-
CLIENT_ID = os.environ['CLIENT_ID']
5-
CLIENT_SECRET = os.environ['CLIENT_SECRET']
6-
FINGERPRINT = os.environ['FINGERPRINT']
4+
CLIENT_ID = os.environ['TEST_CLIENT_ID']
5+
CLIENT_SECRET = os.environ['TEST_CLIENT_SECRET']
6+
FINGERPRINT = 'test_fp'
77
IP_ADDRESS = '127.0.0.1'
88

99
test_client = Client(

0 commit comments

Comments
 (0)