def outCar_choice(name='张三三', carLoad='10'): outCar_list = DriverSelect().driver_select().json()['content'] if outCar_list == []: mobile = DataUtil().createmoble() idNo = DataUtil().genneratorIdNo() carNo = DataUtil().genneratorCarNo() carLength = DataUtil().genneratorCarLength() carModel = DataUtil().genneratorCarTypeInfo() photoIdFront = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'frontIdCard.jpg' photoIdReserve = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'backIdCard.jpg' photoDriverCard = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'photoDriverCard.jpg' photoTransPort = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'photoTransPort.jpg' loginId, Id = CreateDriver().create_driver( name, mobile, idNo, photoIdFront, photoIdReserve, photoDriverCard, photoTransPort, carNo, carLength, carModel, carLoad) outCar = { 'loginId': loginId, 'name': name, 'idNo': idNo, 'mobile': mobile, 'carNo': carNo, 'carLength': carLength, 'carModel': carModel } else: outCar = random.sample(outCar_list, 1)[0] CreateWayBill.my_print('选择的外请车车牌号是: {0}'.format(outCar['carNo'])) return outCar
def setUp(self): self.logger = Log() self.logger.info('########################### TestDriverRelevanceUpdate START ###########################') self.mobile = DataUtil().createmoble() self.idNo = DataUtil().genneratorIdNo() self.carNo = DataUtil().genneratorCarNo() self.carLength = DataUtil().genneratorCarLength() self.carModel = DataUtil().genneratorCarTypeInfo() self.photoIdFront = FileUtil.getProjectObsPath() + os.path.sep + 'image' + os.path.sep + 'frontIdCard.jpg' self.photoIdReserve = FileUtil.getProjectObsPath() + os.path.sep + 'image' + os.path.sep + 'backIdCard.jpg' self.photoDriverCard = FileUtil.getProjectObsPath() + os.path.sep + 'image' + os.path.sep + 'photoDriverCard.jpg' self.photoTransPort = FileUtil.getProjectObsPath() + os.path.sep + 'image' + os.path.sep + 'photoTransPort.jpg' self.loginId = CreateDriver().create_driver('孙师傅', self.mobile, self.idNo, self.photoIdFront, self.photoIdReserve,self.photoDriverCard, self.photoTransPort, self.carNo, self.carLength, self.carModel, '10')[0]
def test_certificate_driver_create_success(self): '''新增已认证外请车 ''' loginId = CreateDriver().create_driver( '黄师傅', self.mobile_certificate, self.idNo, self.photoIdFront, self.photoIdReserve, self.photoDriverCard, self.photoTransPort, self.carNo, self.carLength, self.carModel, '10')[0] driver_list = DriverRelevanceSelect().driver_relevance_select( mobile=self.mobile_certificate).json()['content']['dataList'] if driver_list != []: L = [] for driver in driver_list: L.append(str(driver['loginId'])) self.assertIn(loginId, L, 'Driver created fail!') else: self.logger.error( 'Please check the results of the driver for empty!')