def test_createMonthTicketConfig(self, userLogin, send_data, expect): """创建自定义月票类型""" re = MonthTicketConfig(userLogin).createMonthTicketConfig( send_data['parkName'], send_data['ticketTypeName'], send_data['renewMethod'], send_data['validTo']) result = re Assertions().assert_in_text(result, expect["createMonthTicketConfigMsg"])
def batchOpenMonthTicketBill(self,parkName, typeName, carNum, fileName = '批量开通月票.xls'): """批量开通月票""" file = root_path + '/upload/' + fileName Index(self.Session).downloadExcelTmp("month_ticket_bill.xls", file) ticketConfigDict = self.getDictBykey(MonthTicketConfig(self.Session).getMonthTicketList(parkName,typeName),'ticketName',typeName) self.__editOpenBillFile(file, ticketConfigDict['ticketCode'], carNum) file = { "importFile": open(file, 'rb'), "im12portFile": "self.importFile.importFile" } self.url = "/mgr/monthTicketBill/importBills.do" re = self.post(self.api, files = file, headers = {'User-Agent':'Chrome/71.0.3578.98'}) if re.json()['status'] == 1: re = self.__getImportBillResut() return re.json()['data']
def test_editMonthTicketConfig(self, userLogin, send_data, expect): """售买后,编辑月票类型""" re = MonthTicketConfig(userLogin).editMonthTicketConfig(send_data['parkName'], send_data['ticketTypeName'],send_data['newTicketTypeName']) result = re['status'] Assertions().assert_in_text(result, expect["editMonthTicketConfigMsg"])
def test_setMonthTicketConfigValid(self, userLogin, send_data, expect): """设置月票类型上架""" re = MonthTicketConfig(userLogin).updateStatusMonthTicketConfig(send_data['parkName'], send_data['ticketTypeName'],send_data['upTicketStatus']) result = re Assertions().assert_in_text(result, expect["setMonthTicketConfigValidMsg"])
def test_createMonthTicketConfig(self, userLogin, send_data, expect): """创建多位多车月票类型""" re = MonthTicketConfig(userLogin).createMonthTicketConfig(send_data['parkName'], send_data['ticketTypeName'], send_data['renewMethod'], send_data['validTo'],isDynamicMode=send_data['isDynamicMode'],autoSwitchVip=send_data['autoSwitchVip']) result = re Assertions().assert_in_text(result, expect["createMonthTicketConfigMsg"])