def testadd(self,data): '''活动管理接口:新添加活动#/project/activity/add''' b = data['Add']['code'] c = data['Add']['name'] newcode = b + str(scripts.sjshu()) newname = c + str(scripts.sjshu()) data['Add']['code'] = newcode data['Add']['name'] = newname # 新添加活动 res = scripts.loadtestInterface( instance=HttpWebRequest(), instance_pro='post', data=data['Add'], desc=data['Desc'], url=data['Url'] ) #断言 self.assertEqual(res['code'],0,res['msg'])
def testupdata(self, data): '''后台巡检管理: 更新人员#/check/user/update''' b = data['updata']['cardNo'] c = data['updata']['phone'] d = data['updata']['name'] newcode = b + str(scripts.sjshu()) newphone = c + str(scripts.sjshu()) newname = d + str(scripts.sjshu()) print newcode print newphone print newname data['updata']['cardNo'] = newcode data['updata']['phone'] = newphone data['updata']['name'] = newname # 更新人员 res = scripts.loadtestInterface(instance=HttpWebRequests(), instance_pro='post', data=json.dumps(data['updata']), desc=data['Desc'], url=data['Url']) #断言 self.assertEqual(res['code'], 0, res['msg'])
def testsave(self, data): '''后台巡检管理: 新增工单/check/fault/save''' b = data['save']['remark'] newcode = b + str(scripts.sjshu()) data['save']['remark'] = newcode # 巡检管理 更新类型 res = scripts.loadtestInterface(instance=HttpWebRequest(), data=data['save'], desc=data['Desc'], url=data['Url'], instance_pro='post') # 断言 self.assertEqual(res['code'], 0, res['msg']) # 断言
def testudpatafault(self, data): '''后台巡检管理: 更新类型/check/faultType/udpatafault''' b = data['udpatafault']['name'] newcode = b + str(scripts.sjshu()) data['udpatafault']['name'] = newcode # 巡检管理 更新类型 res = scripts.loadtestInterface(instance=HttpWebRequests(), data=json.dumps(data['udpatafault']), desc=data['Desc'], url=data['Url'], instance_pro='post') # 断言 self.assertEqual(res['code'], 0, res['msg']) # 断言
def testadd(self, data): '''项目管理接口:新添加商品#/project/goods/add''' b = data['Add']['code'] print b newcode = b + str(scripts.sjshu()) print newcode data['Add']['code'] = newcode # 新添加商品 res = scripts.loadtestInterface(instance=HttpWebRequest(), instance_pro='post', data=data['Add'], desc=data['Desc'], url=data['Url']) #断言 self.assertEqual(res['code'], 0, res['msg'])
def testadd(self, data): '''点位管理接口:新添加点位#/machine/locale/add''' b = data['Add']['name'] print b newcode = b + str(scripts.sjshu()) print newcode data['Add']['name'] = newcode # 新添加点位 res = scripts.loadtestInterface(instance=HttpWebRequest(), instance_pro='post', data=data['Add'], desc=data['Desc'], url=data['Url']) # print res # print type(res) #断言 self.assertEqual(res['code'], 0, res['msg'])