def test01case(self): case01_data = readExcel().get_xls('userCase.xlsx','invitation')[1] case01_case_name = case01_data[0] case01_deviceNum = case01_data[1] case01_method = case01_data[2] print(case01_case_name,case01_deviceNum,case01_method) self.checkResult(case01_case_name,case01_deviceNum,case01_method)
def __init__(self, master=None): Frame.__init__(self, master) self.readExcel = readExcel() self.fitsImage = fitsImageProcessing() self.ucacReg = Ucac4Processing() self.matching = Matching() self.fullImageL = None self.fullImageR = None #reference to the master widget, which is the tk window self.master = master self.panelA = None self.panelB = None self.panelZ = None self.textL = None self.textR = None self.rezultatLabel = None self.rezultatLabel1 = None self.listBox = None self.sliderA = None self.sliderB = None self.init_window()
def excelToXml(): readExcel(name='test.xls').read()
def send_post(self,url,data):# 定义一个方法,传入需要的参数url和data # 参数必须按照url、data顺序传入 result = requests.post(url=url, data=data).json()# 因为这里要封装post方法,所以这里的url和data值不能写死 res = json.dumps(result, ensure_ascii=False, sort_keys=True, indent=2) return res def send_get(self,url,data): result = requests.get(url=url, data=data) res = json.dumps(result, ensure_ascii=False, sort_keys=True, indent=2) return res def run_main(self,method,url=None,data=None):#定义一个run_main函数,通过传过来的method来进行不同的get或post请求 result = None if method == 'post': result = self.send_post(url,data) logger.info(str(result)) elif method == 'get': result = self.send_get(url,data) logger.info(str(result)) else: print("method值错误!!!") logger.info("method值错误!!!") return result if __name__ == '__main__':#通过写死参数,来验证请求是否正 rde = readExcel('userCase.xlsx', '登录') #result=RunMain().run_main('post','http://jydnew.dev.jinr.com',{"data":'{"method":"user.login","v":"1.0.0","platform":"4","appid":"app_key","timestamp":"1552012801","mobile":"15872896008","login_type":"pwd","code":"123456","user_role":"2"}'}) #print(result) #print(type(result))
import json import unittest from common.configHttp import RunMain import urllib.parse import readExcel import geturlParams import paramunittest # 类似与ddt数据驱动 url = geturlParams.geturlParams().get_Url() #调用通过geturlParams获取我们拼接的URL。 sheet_xls = readExcel().get_xls('serverapkCase.xlsx', 'Sheet1') @paramunittest.parametrized(*sheet_xls) class testServerApk(unittest.TestCase): def setParameters(self, case_name, path, query, method): self.case_name = str(case_name) self.path = str(path) self.query = str(query) self.method = str(method) def description(self): """ test report description """ self.case_name def setUp(self): print(self.case_name + "测试开始前准备") def test01case(self): self.checkResult()
def __init__(self): self.__image = fitsImageProcessing() self.__ucacReg = Ucac4Processing() self.__operation = Operations() self.__exelR = readExcel()