Skip to content

Commit

Permalink
Merge pull request #31 from skyflowapi/header-fix
Browse files Browse the repository at this point in the history
fixed header issue
  • Loading branch information
yennamsanthosh-skyflow authored Jan 18, 2022
2 parents e5406b8 + a8dce77 commit 6ec242c
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions tests/Vault/testInvokeConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,38 +115,37 @@ def testVerifyParamsInvalidQueryParams(self):
self.assertEqual(e.code, SkyflowErrorCodes.INVALID_INPUT.value)
self.assertEqual(e.message, SkyflowErrorMessages.INVALID_QUERY_PARAMS.value)

def testinvokeConnectionCvvGenSuccess(self):
env_values = dotenv_values('.env')
connectionURL = env_values['CVV_GEN_CONNECTION_URL']

def tokenProvider():
token, _ = generateBearerToken(env_values['CREDENTIALS_FILE_PATH'])
return token

config = Configuration(env_values['VAULT_ID'], env_values['VAULT_URL'], tokenProvider)
connectionConfig = ConnectionConfig(connectionURL, RequestMethod.POST,
requestHeader={
'Content-Type': 'application/json',
'Authorization': env_values['VISA_CONNECTION_BASIC_AUTH']
},
requestBody=
{
"expirationDate": {
"mm": "12",
"yy": "22"
}
},
pathParams={'cardID': env_values['DETOKENIZE_TEST_TOKEN']})
client = Client(config)


try:
resp = client.invokeConnection(connectionConfig)
self.assertIsNotNone(resp['resource']['cvv2'])
self.assertIsNotNone(resp['processingTimeinMs'])
self.assertIsNotNone(resp['receivedTimestamp'])
except SkyflowError as e:
print(e)
# def testinvokeConnectionCvvGenSuccess(self):
# env_values = dotenv_values('.env')
# connectionURL = env_values['CVV_GEN_CONNECTION_URL']

# def tokenProvider():
# token, _ = generateBearerToken(env_values['CREDENTIALS_FILE_PATH'])
# return token

# config = Configuration(env_values['VAULT_ID'], env_values['VAULT_URL'], tokenProvider)
# connectionConfig = ConnectionConfig(connectionURL, RequestMethod.POST,
# requestHeader={
# 'Content-Type': 'application/json',
# 'Authorization': env_values['VISA_CONNECTION_BASIC_AUTH']
# },
# requestBody=
# {
# "expirationDate": {
# "mm": "12",
# "yy": "22"
# }
# },
# pathParams={'cardID': env_values['DETOKENIZE_TEST_TOKEN']})
# client = Client(config)


# try:
# resp = client.invokeConnection(connectionConfig)
# self.assertIsNotNone(resp['resource']['cvv2'])
# self.assertIsNotNone(resp['processingTimeinMs'])
# self.assertIsNotNone(resp['receivedTimestamp'])
# except SkyflowError as e:
# print(e)
# self.fail()

testInvokeConnection().testinvokeConnectionCvvGenSuccess()

0 comments on commit 6ec242c

Please sign in to comment.