def test_my_demo_params(args1, args2=None, msg=None): log.step(msg) my_demo_api = MyServiceDemoApi() my_demo_api.body.args_1 = args1 my_demo_api.body.args_2 = args2 my_demo_api.send_request() my_demo_api.check()
def do(self, ex=None): self.exclude.extend(ex) if ex else self.exclude log.step('开始对比如下表数据:{}'.format(self.actual_obj.__dict__.keys())) from common.ObjAssert import ObjAssert check = ObjAssert() check.is_equal(exp_obj=self.expect_obj, act_obj=self.actual_obj, is_toggle=False, ex=self.exclude)
def test_coupon_create_strong(): log.step("验证优惠券价格=100时候接口逻辑正确") my_demo_api = CouponCreateApi(amount=0, name="jfkdjfdo") # my_demo_api.body.productCategoryRelationList = [] my_demo_api.add_cate_relation(couponId='11111', parentCategoryName='3232') # for k in xxxx: # my_demo_api.add_cate_relation(**k) # my_demo_api.body.amount = 100 my_demo_api.send_request() my_demo_api.check()
def test_coupon_list_success(pageSize, pageNum, name, type, msg=None, code=200): log.step(msg) api_obj = CouponList(pageSize=pageSize, pageNum=pageNum, name=name, type=type, status=code) return api_obj
def test_coupon_create_time_v2(input={}, msg=None, code=200): log.step(msg) api_obj = CouponCreateApi(status=code, **input) return api_obj
def test_coupon_create_amount_v2(req_data={}, msg=None): log.step(msg) api_obj = CouponCreateApi(**req_data) return api_obj
def test_coupon_create_strong_amount_v2(req_data={}, msg=None, code=200): log.step(msg) api_obj = CouponCreateApi(status=code, **req_data) # api_obj.send_request() # api_obj.check() return api_obj
def test_coupon_create_check_amount_success(req_data={}, msg=None, code=200): log.step(msg) api_obj = CouponCreateApi(status=code, **req_data) return api_obj
def test_coupon_compare_other_api(input={}, msg=None): log.step(msg) api_obj = CouponCreateApi(**input) return api_obj
def test_combo_coupon_type_and_user_type(user_type_all, coupon_type_all): log.step("验证用户类型和优惠券类型组合情况创建优惠券成功") api_obj = CouponCreateApi(type=coupon_type_all, useType=user_type_all) return api_obj
def test_coupon_id_success(coupon_id, msg=None, code=200): log.step(msg) api_obj = CouponId(coupon_id=coupon_id, status=code) return api_obj