1+ import string
2+ import random
3+
14from events_api import test_events_api
25from decisions_api import test_decisions_api
36from workflows_api import test_workflows_api
@@ -22,7 +25,6 @@ def runAllMethods():
2225 objPSPMerchant = test_psp_merchant_api .PSPMerchantAPI ()
2326
2427 #Events APIs
25-
2628 assert (objUtils .isOK (objEvents .add_item_to_cart ()) == True )
2729 assert (objUtils .isOK (objEvents .add_promotion ()) == True )
2830 assert (objUtils .isOK (objEvents .chargeback ()) == True )
@@ -54,48 +56,43 @@ def runAllMethods():
5456 assert (objUtils .isOK (objEvents .update_password ()) == True )
5557 assert (objUtils .isOK (objEvents .verification ()) == True )
5658 print ("Events API Tested" )
57-
58- # Decision APIs
5959
60- assert (objUtils .isOK (objDecision .apply_user_decision ()) == False )
61- assert (objUtils .isOK (objDecision .apply_order_decision ()) == False )
62- assert (objUtils .isOK (objDecision .apply_session_decision ()) == False )
63- assert (objUtils .isOK (objDecision .apply_content_decision ()) == False )
60+ # Decision APIs
61+ assert (objUtils .isOK (objDecision .apply_user_decision ()) == True )
62+ assert (objUtils .isOK (objDecision .apply_order_decision ()) == True )
63+ assert (objUtils .isOK (objDecision .apply_session_decision ()) == True )
64+ assert (objUtils .isOK (objDecision .apply_content_decision ()) == True )
6465 assert (objUtils .isOK (objDecision .get_user_decisions ()) == True )
6566 assert (objUtils .isOK (objDecision .get_order_decisions ()) == True )
6667 assert (objUtils .isOK (objDecision .get_content_decisions ()) == True )
6768 assert (objUtils .isOK (objDecision .get_session_decisions ()) == True )
6869 assert (objUtils .isOK (objDecision .get_decisions ()) == True )
6970 print ("Decision API Tested" )
70-
71- # Workflows APIs
7271
72+ # Workflows APIs
7373 assert (objUtils .isOK (objWorkflow .synchronous_workflows ()) == True )
7474 print ("Workflow API Tested" )
75-
76- # Score APIs
7775
78- assert (objUtils .isOK (objScore .get_user_score ()) == False )
76+ # Score APIs
77+ assert (objUtils .isOK (objScore .get_user_score ()) == True )
7978 print ("Score API Tested" )
80-
81- # Verification APIs
8279
80+ # Verification APIs
8381 assert (objUtils .isOK (objVerification .send ()) == True )
8482 assert (objUtils .isOK (objVerification .resend ()) == True )
8583 checkResponse = objVerification .check ()
8684 assert (objUtils .isOK (checkResponse ) == True )
8785 assert (checkResponse .body ["status" ] == 50 )
8886 print ("Verification API Tested" )
89-
90- # PSP Merchant APIs
9187
92- assert (objUtils .isOK (objPSPMerchant .create_merchant ()) == True )
93- assert (objUtils .isOK (objPSPMerchant .edit_merchant ()) == True )
94- assert (objUtils .isOK (objPSPMerchant .get_a_merchant_profile ()) == True )
88+ # PSP Merchant APIs
89+ merchant_id = 'merchant_id_test_app' + '' .join (random .choices (string .digits , k = 7 ))
90+ assert (objUtils .isOK (objPSPMerchant .create_merchant (merchant_id )) == True )
91+ assert (objUtils .isOK (objPSPMerchant .edit_merchant (merchant_id )) == True )
9592 assert (objUtils .isOK (objPSPMerchant .get_merchant_profiles ()) == True )
9693 assert (objUtils .isOK (objPSPMerchant .get_merchant_profiles (batch_size = 10 , batch_token = None )) == True )
9794 print ("PSP Merchant API Tested" )
98-
99- print ("Execution completed " )
95+
96+ print ("API Integration tests execution finished " )
10097
10198runAllMethods ()
0 commit comments