def test_LUCI_RSC_002(self, description, config): couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions( self, config) LuciHelper.queuePumpWait(self, couponSeriesId) # Issue Coupon Code couponCode = LuciHelper.issueCouponAndAssertions(self, couponSeriesId)[0] resendRequest = LuciObject.resendCouponRequest({ 'storeUnitId': self.tillId, 'eventTimeInMillis': Utils.getTime(milliSeconds=True), 'couponCode': couponCode, 'userId': self.userId }) couponDetails = self.connObj.resendCoupon(resendRequest).__dict__ Assertion.constructAssertion( couponCode == couponDetails['couponCode'], 'Resend Coupon Code Actual: {} and Expected: {}'.format( couponCode, couponDetails['couponCode'])) Assertion.constructAssertion( couponDetails['ex'] == None, 'Resend Coupon No exception occurred : {}'.format( couponDetails['ex']))
def test_LUCI_RSC_004(self, description, config): expectedMsg = 'resend message not enabled for series id : {}' try: couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions( self, config) expectedMsg = expectedMsg.format(couponSeriesId) LuciHelper.queuePumpWait(self, couponSeriesId) # Issue Coupon Code couponCode = LuciHelper.issueCouponAndAssertions( self, couponSeriesId)[0] resendRequest = LuciObject.resendCouponRequest({ 'storeUnitId': self.tillId, 'eventTimeInMillis': Utils.getTime(milliSeconds=True), 'couponCode': couponCode, 'userId': self.userId }) couponDetails = self.connObj.resendCoupon(resendRequest).__dict__ Assertion.constructAssertion( couponCode == couponDetails['couponCode'], 'Resend Coupon Code Actual: {} and Expected: {}'.format( couponCode, couponDetails['couponCode'])) Assertion.constructAssertion( couponDetails['ex'] == None, 'Resend Coupon No exception occurred : {}'.format( couponDetails['ex'])) except Exception, luciExp: luciExp = luciExp.__dict__ Assertion.constructAssertion( luciExp['errorCode'] == 653, 'Resend error Code Actual : {} and Expected: {}'.format( luciExp['errorCode'], 653)) Assertion.constructAssertion( luciExp['errorMsg'] == expectedMsg, 'Resend error Message Actual : {} and Expected: {}'.format( luciExp['errorMsg'], expectedMsg))
def test_LUCI_RSC_Invalid_001(self, description, smsTemplate): try: couponConfigObj, couponSeriesId = LuciHelper.saveCouponConfigAndAssertions( self, {'sms_template': smsTemplate}) LuciHelper.queuePumpWait(self, couponSeriesId) # Issue Coupon Code couponCode = LuciHelper.issueCouponAndAssertions( self, couponSeriesId)[0] resendRequest = LuciObject.resendCouponRequest({ 'storeUnitId': self.tillId, 'eventTimeInMillis': Utils.getTime(milliSeconds=True), 'couponCode': couponCode, 'userId': self.userId }) couponDetails = self.connObj.resendCoupon(resendRequest).__dict__ Assertion.constructAssertion( couponCode == couponDetails['couponCode'], 'Resend Coupon Code Actual: {} and Expected: {}'.format( couponCode, couponDetails['couponCode'])) Assertion.constructAssertion( couponDetails['ex'] == None, 'Resend Coupon No exception occurred : {}'.format( couponDetails['ex'])) except Exception, luciException: luciException = luciException.__dict__ Assertion.constructAssertion( luciException['errorCode'] == 644, 'Redemption error Code Actual : {} and Expected: {}'.format( luciException['errorCode'], 644)) Assertion.constructAssertion( luciException['errorMsg'] == 'unresolved tags are present', 'Redemption error Message Actual : {} and Expected: {}'.format( luciException['errorMsg'], 'unresolved tags are present'))