File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22from 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+
811FINGERPRINT = 'test_fp'
912IP_ADDRESS = '127.0.0.1'
1013
Original file line number Diff line number Diff line change 88from synapse_pay_rest .models import SocialDocument
99from synapse_pay_rest .models import VirtualDocument
1010from 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
1316class 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 )
You can’t perform that action at this time.
0 commit comments