def test_waybill_detail_get_success(self): '''获取运单详情''' response = WayBillDetailGet().waybill_detail_get(self.wayBillId) self.logger.info('获取运单详情返回状态码:{0}'.format(response)) self.assertEqual(response.status_code, 200) self.logger.info('模获取运单详情查询结果是:{0}'.format(response.json())) self.assertEqual(response.json()['code'], 0)
def setUp(self): self.logger = Log() self.logger.info( '######################## TestProfitReportSelect START ########################' ) carType = str(random.randint(1, 2)) self.applyDate = time.strftime('%Y-%m-%d') photoAirWay = FileUtil.getProjectObsPath() + '/image/photoAirWay.jpg' receipt_0 = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'logo.png' wayBillId = CreateWayBill().create_waybill( carType, self.applyDate, photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行', '张三')[0] WayBillDepartureConfirm().waybill_departure_confirm(wayBillId) waybill_transport_detail = WayBillDetailGet().waybill_detail_get( wayBillId).json()['content'] self.wayBillNo = waybill_transport_detail['transportCash'][ 'tmsBillCode'] WayBillArrivalConfirm().waybill_arrival_confirm( wayBillId, waybill_transport_detail['transportCash']['destAmt'], waybill_transport_detail['transportCash']['destAmtMemo']) WayBillReceiptUpload().waybill_receipt_upload(wayBillId, 'Y', 'Y', 'N', '回单上传测试', 'C', receipt_0) waybill_arrived_detail = WayBillDetailGet().waybill_detail_get( wayBillId).json()['content'] WayBillReceiptConfirm().waybill_receipt_confirm( wayBillId, waybill_arrived_detail['transportCash']['retAmt'], '金额变动', '有异常', receipt_0)
def test_waybill_receipt_get_success(self): '''获取回单详情''' WayBillDepartureConfirm().waybill_departure_confirm(self.wayBillId) waybill_transport_detail = WayBillDetailGet().waybill_detail_get( self.wayBillId).json()['content'] WayBillArrivalConfirm().waybill_arrival_confirm( self.wayBillId, waybill_transport_detail['transportCash']['destAmt'], waybill_transport_detail['transportCash']['destAmtMemo']) WayBillReceiptUpload().waybill_receipt_upload(self.wayBillId, 'Y', 'Y', 'N', '回单上传测试', 'C', self.receipt_0) response = WayBillReceiptGet().waybill_receipt_get(self.wayBillId) self.logger.info('获取回单详情回状态码:{0}'.format(response)) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0) self.logger.info('获取回单详情返回结果:{0}'.format(response.json())) waybill_arrived_detail = WayBillDetailGet().waybill_detail_get( self.wayBillId).json()['content'] self.logger.info('获取回单详情的运单号是:{0}'.format( waybill_arrived_detail['transportCashDetail']['tmsBillCode'])) self.assertEqual(waybill_arrived_detail['transportCash']['billStatus'], 'H') self.assertEqual( waybill_arrived_detail['transportCash']['transStatus'], 'A')
def test_waybill_receipt_confirm_success(self): '''货主回单上传、回单确认''' WayBillDepartureConfirm().waybill_departure_confirm(self.wayBillId) waybill_transport_detail = WayBillDetailGet().waybill_detail_get(self.wayBillId).json()['content'] WayBillArrivalConfirm().waybill_arrival_confirm(self.wayBillId,waybill_transport_detail['transportCash']['destAmt'], waybill_transport_detail['transportCash']['destAmtMemo']) WayBillReceiptUpload().waybill_receipt_upload(self.wayBillId,'Y','Y','N','回单上传测试','C',self.receipt_0) waybill_arrived_detail = WayBillDetailGet().waybill_detail_get(self.wayBillId).json()['content'] response = WayBillReceiptConfirm().waybill_receipt_confirm(self.wayBillId, waybill_arrived_detail['transportCash']['retAmt'],'金额变动','有异常') self.logger.info('回单确认返回状态码:{0}'.format(response)) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0) waybill_completed_detail = WayBillDetailGet().waybill_detail_get(self.wayBillId).json()['content'] self.logger.info('回单确认的运单号是:{0}'.format(waybill_completed_detail['transportCashDetail']['tmsBillCode'])) self.assertEqual(waybill_completed_detail['transportCash']['billStatus'], 'S') self.assertEqual(waybill_completed_detail['transportCash']['transStatus'],'C')
def test_waybill_arrival_confirm_success(self): '''到达确认''' WayBillDepartureConfirm().waybill_departure_confirm(self.wayBillId) waybill_transport_detail = WayBillDetailGet().waybill_detail_get( self.wayBillId).json()['content'] response = WayBillArrivalConfirm().waybill_arrival_confirm( self.wayBillId, waybill_transport_detail['transportCash']['destAmt'], waybill_transport_detail['transportCash']['destAmtMemo']) self.logger.info('到达确认返回状态码:{0}'.format(response)) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0) waybill_arrived_detail = WayBillDetailGet().waybill_detail_get( self.wayBillId).json()['content'] self.logger.info('到达确认的运单号是:{0}'.format( waybill_arrived_detail['transportCashDetail']['tmsBillCode'])) self.assertEqual(waybill_arrived_detail['transportCash']['billStatus'], 'D') self.assertEqual( waybill_arrived_detail['transportCash']['transStatus'], 'A')
def setUp(self): self.logger = Log() self.logger.info('######################## TestDepartureConfirmWayBill START ########################') carType = str(random.randint(1, 2)) applyDate = time.strftime('%Y-%m-%d') photoAirWay = FileUtil.getProjectObsPath() + '/image/photoAirWay.jpg' self.wayBillId = CreateWayBill().create_waybill(carType, applyDate, photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行','张三')[0] wayBillNo = WayBillDetailGet().waybill_detail_get(self.wayBillId).json()['content']['transportCashDetail']['tmsBillCode'] self.logger.info('添加跟踪备注信息的运单号是:{0}'.format(wayBillNo))
def test_waybill_update_applyDate_success(self): '''修改运单的发车时间''' self.applyDate_update = time.strftime( '%Y-%m-%d', time.localtime(time.time() + 172800)) response = WayBillUpdate().waybill_update( self.wayBillId, self.carType, self.applyDate_update, self.projectName, self.projectId, self.supplierName, self.supplierId, self.name, self.idNo, self.mobile, self.carNo, self.carLength, self.carModel, self.photoAirWay, '', '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行', '张三') self.logger.info('请求url:{0} '.format(response.request.url)) self.logger.info('请求body:{0} '.format(response.request.body)) self.logger.info('修改运单的发车时间返回状态码:{0}'.format(response)) self.logger.info('修改运单的发车时间返回:{0}'.format(response.json())) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0) response_get = WayBillDetailGet().waybill_detail_get(self.wayBillId) self.assertEqual( self.applyDate_update, response_get.json()['content']['transportCash']['applyDate'], 'Waybill updated fail!')
def test_defined_fee_update_success(self): response = DefinedFeeUpdate().defined_fee_update(self.waybillID, handlingFee=self.handlingFee, deliveryFee=self.deliveryFee, oilCardDeposit=self.oilCardDeposit, otherFee=self.otherFee) self.logger.info('修改运单自定义费用金额为10.') self.logger.info('修改结果:{0}'.format(response.json())) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0) wayBillDetail = WayBillDetailGet().waybill_detail_get(self.waybillID).json()['content']['transportCashDetail'] self.logger.info('修改后的运单详情:{0}'.format(wayBillDetail)) self.assertEqual(wayBillDetail['handlingFee'], self.handlingFee) self.assertEqual(wayBillDetail['deliveryFee'], self.deliveryFee) self.assertEqual(wayBillDetail['oilCardDeposit'], self.oilCardDeposit) self.assertEqual(wayBillDetail['otherFee'], self.otherFee)