Skip to content

Commit 17cf984

Browse files
authored
Merge pull request SynapseFI#48 from synapsepay/dev2
Update test prompt for client keys and add relative path for test physical doc file
2 parents 4668d96 + bd48722 commit 17cf984

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

synapse_pay_rest/tests/fixtures/client.py

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

4-
# CLIENT_ID = os.environ['TEST_CLIENT_ID']
5-
# CLIENT_SECRET = os.environ['TEST_CLIENT_SECRET']
6-
CLIENT_ID = input("Please enter client ID")
7-
CLIENT_SECRET = input("Please enter client secret")
4+
try:
5+
CLIENT_ID = os.environ['TEST_CLIENT_ID']
6+
CLIENT_SECRET = os.environ['TEST_CLIENT_SECRET']
7+
except KeyError:
8+
CLIENT_ID = input("Please enter client ID: ")
9+
CLIENT_SECRET = input("Please enter client secret: ")
10+
811
FINGERPRINT = 'test_fp'
912
IP_ADDRESS = '127.0.0.1'
1013

synapse_pay_rest/tests/models/document_tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
from synapse_pay_rest.models import SocialDocument
99
from synapse_pay_rest.models import VirtualDocument
1010
from synapse_pay_rest.models import Question
11+
import os
12+
dir = os.path.dirname(__file__)
13+
filename = os.path.join(dir, '../fixtures/test.png')
1114

1215

1316
class DocumentTestCases(unittest.TestCase):
@@ -36,7 +39,7 @@ def setUp(self):
3639

3740
def test_physical_document_with_bytestream(self):
3841
type = 'GOVT_ID'
39-
file_path = input("Input file test file full path")
42+
file_path = filename
4043
byte_stream = open(file_path, 'rb').read()
4144
doc = self.base_document.add_physical_document(type=type,
4245
byte_stream=byte_stream,
@@ -45,7 +48,7 @@ def test_physical_document_with_bytestream(self):
4548

4649
def test_physical_document_with_file_path(self):
4750
type = 'GOVT_ID'
48-
file_path = input("Input file test file full path")
51+
file_path = filename
4952
doc = self.base_document.add_physical_document(type=type,
5053
file_path=file_path)
5154
self.assertIsInstance(doc, PhysicalDocument)

0 commit comments

Comments
 (0)