Skip to content

Commit e6f93e3

Browse files
author
krgupta
committed
testsample with getCustomerProfile and getCustomerShippingAddress test
1 parent a7d7a1e commit e6f93e3

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

tests/testssample.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,31 @@ def testPropertyFromFile(self):
2020
self.assertIsNotNone(login)
2121
self.assertIsNotNone(transactionkey)
2222

23+
class shippingAddressUnitTest(apitestbase.ApiTestBase):
24+
def testget_customer_shipping_address(self):
25+
# create get shipping address request
26+
getShippingAddress = apicontractsv1.getCustomerShippingAddressRequest()
27+
getShippingAddress.merchantAuthentication = self.merchantAuthentication
28+
getShippingAddress.customerProfileId = '40812683'
29+
getShippingAddress.customerAddressId = '38558024'
30+
31+
# Make the API call
32+
getShippingAddressController = getCustomerShippingAddressController(getShippingAddress)
33+
getShippingAddressController.execute()
34+
response = getShippingAddressController.getresponse()
35+
self.assertEquals('Ok', response.messages.resultCode)
36+
37+
class customerprofileUnitTest(apitestbase.ApiTestBase):
38+
def testget_customer_profile(self):
39+
getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
40+
getCustomerProfile.merchantAuthentication = self.merchantAuthentication
41+
getCustomerProfile.customerProfileId = '40812683'
42+
controller = getCustomerProfileController(getCustomerProfile)
43+
controller.execute()
44+
response = controller.getresponse()
45+
self.assertEquals('Ok', response.messages.resultCode)
46+
47+
2348
class test_TransactionReportingUnitTest(apitestbase.ApiTestBase):
2449
def testGetTransactionDetails(self):
2550
gettransactiondetailsrequest = apicontractsv1.getTransactionDetailsRequest()
@@ -29,7 +54,13 @@ def testGetTransactionDetails(self):
2954
gettransactiondetailscontroller.execute()
3055
response = gettransactiondetailscontroller.getresponse()
3156
self.assertEquals('Ok', response.messages.resultCode)
32-
self.assertIsNotNone(response.transaction.payment.creditCard.cardNumber)
57+
self.assertIsNotNone(response.transaction.payment.creditCard.cardNumber)
58+
# value = getattr(response.messages.message, 'text')
59+
# print ("value = %s" %value)
60+
# if hasattr(response, 'messages') == True:
61+
# if hasattr(response.messages, 'message') == True:
62+
# if hasattr(response.messages.message, 'text') == True:
63+
# print ("message code = %s " %(response.messages.message.text))
3364

3465
class test_RecurringBillingTest(apitestbase.ApiTestBase):
3566
createdSubscriptionId = None
@@ -186,6 +217,7 @@ def testGetTransactionDetails_UserAddsInvalidPropertyWhichIsNOTInRequestObject(s
186217
self.assertIsNotNone(response.transaction.billTo.company)
187218
self.assertIsNotNone(response.transaction.entryMethod)
188219
self.assertIsNotNone(response.transaction.order.invoiceNumber)
220+
189221
'''
190222
class test_PaymentTransactions(apitestbase.ApiTestBase):
191223
#Testing SDK SimpleType

0 commit comments

Comments
 (0)