def test_016_historyCarRecord(self): financeid = fs.get_car_id(c.car_owner) # 车辆档案,只读,支持finance warn monitor三个模块的权限 f.test_historyCarRecord_customerMessage(financeid) # 获取车辆的车贷数据 r = json.loads(f.test_historyCarRecord_getCarFinance(financeid)) a.verity(r['data']['owner'], c.car_owner) # 获取车辆设备页面初始化数据 f.test_historyCarRecord_getCarInit(financeid) # 获取该车辆的实时定位数据 f.test_historyCarRecord_getCarLocations(financeid) # 获取车辆的报警记录 f.test_historyCarRecord_getCarWarn(financeid, 1, 10) # 获取车辆设备的报警统计信息 f.test_historyCarRecord_getCarWarnCount(financeid) # 车辆档案--获取gps设备列表 f.test_historyCarRecord_getGpsByFid(financeid) # 车辆档案--停车统计--常停地址 f.test_historyCarRecord_listLocation( '', orgCode, '', 1, 10, financeid, c.deviceCode, c.station_starttime, c.station_endtime, 1) # 车辆档案--停车统计--时间分布 f.test_historyCarRecord_quantumLocation( 1, c.deviceCode, c.station_starttime, c.station_endtime) # 车辆档案--停车统计--停车明细 f.test_historyCarRecord_stationDetail( '', '', '', 1, 10, 1, c.deviceCode, c.station_starttime, c.station_endtime, 1)
def test_023_install_add(self): """ Time :2019-04-08 author : 罗林 desc :创建安装 """ car_id = fis.get_car_id(car_owner) device_id = fis.get_device_id(new_device_code) rs1 = cla.test_install_add(carid=car_id, equipmentids=device_id, username=installer) ass.verity(json.loads(rs1)['message'], '请求成功')
def test_008_finance_getDetail(self): # 获取车贷数据详情 self.car_id = fs.get_car_id(c.car_owner) r7 = json.loads(f.test_finance_getDetail(self.car_id)) a.verity(r7['data']['borrowType'], 'XZ', '断言贷款性质') a.verity(r7['data']['carNo'], c.carNo, '断言车牌号') a.verity(r7['data']['owner'], c.car_owner, '断言owner') a.verity(r7['data']['rePayManner'], 'DBDX', '断言还款方式') a.verity(r7['data']['orgCode'], orgCode, '断言orgCode') a.verity(r7['data']['id'], self.car_id[0][0], '断言车牌id')
def test_012_warnDist(self): # 处理报警信息页面初始化数据 finance_id = fs.get_car_id(c.car_owner) warnid = fs.get_warn_id(warn_type='jl', financeid=finance_id) f.test_warnDist_getHandleWarnMessage(warnid) # 查看设备距离报警信息 f.test_warnDist_getDeviceWarnIntervalDetail(warnid) # 获取设备距离报警记录 f.test_warnDist_getWarnIntervals('', 1, 10, 0) # 执行报警信息处理 f.test_warnDist_doHandleWarn(99, 'test 其它', 'test 备注', 3, warnid)
def test_001_warn(self): # 处理报警信息页面初始化数据 finance_id = fs.get_car_id(c.car_owner) warnid = fs.get_warn_id(warn_type='sh', financeid=finance_id) r = json.loads(f.test_warn_getHandleWarnMessage(warnid)) a.verity(r['data']['warnid'], warnid, '断言warnid') # 获取设备报警记录 f.test_warn_getWarns('', 1, 10, 0) riskid = fs.get_risk_id(c.riskName) # 根据ID获取风险点详情 r1 = json.loads(f.test_warn_getRiskDetail(riskid)) a.verity(r1['data']['id'], riskid, '断言riskid') # 根据报警记录ID获取报警记录详情 f.test_warn_getWarnDetailById() f.test_warn_doHandleWarn(1, '', '', 1, warnid)
def test_006_finance_save(self): # 新增车贷数据 r5 = json.loads(f. test_finance_save(0, '', '', '', '', '', '', True, '', '', '', c.car_owner, 'DBDX', 1, '', 1, '四川省成都市武侯区桂溪街道天府大道北段', '104.068402,30.572893', '四川省成都市武侯区桂溪街道益州大道中段674号成都高新孵化园', '104.06432,30.572869', 'XZ', '', 1, '', '', '', c.carNo, orgCode, '13600000016')) self.car_id = fs.get_car_id(c.car_owner) a.verity(r5['data']['borrowType'], 'XZ', '断言贷款性质') a.verity(r5['data']['carNo'], c.carNo, '断言车牌号') a.verity(r5['data']['owner'], c.car_owner, '断言owner') a.verity(r5['data']['rePayManner'], 'DBDX', '断言还款方式') a.verity(r5['data']['orgCode'], orgCode, '断言orgCode') a.verity(r5['data']['id'], self.car_id[0][0], '断言车牌id')
def test_014_gps(self): gpsid, gpscode = fs.get_gps()[0] finance_id = fs.get_car_id(c.car_owner) # 获取机构信息 r = json.loads(f.test_install_getLowerOrg()) a.verity(r['data'][0]['name'], c.companyName) a.verity(r['data'][0]['orgCode'], orgCode) # 获取GPS设备 f.test_install_getDevice(gpscode, orgCode) # 获取GPS类型 f.test_install_getGpsType() # 获取GPS型号 f.test_install_getGpsMoudel('有线') f.test_install_getGpsMoudel('无线') # 根据所在机构获取GPS设备信息 r1 = json.loads(f.test_install_getDeviceByOrgCode(gpsid, orgCode)) a.verityContain(r1['data'], gpscode) a.verityContain(r1['data'], str(gpsid)) # 安装车辆搜索联想 r2 = json.loads(f.test_install_installCarSearchAssociate(c.car_owner, orgCode)) a.verity(r2['data'][0]['fid'], finance_id) a.verity(r2['data'][0]['carNo'], c.carNo) a.verity(r2['data'][0]['carNoAndOwner'], c.carNo + ' ' + c.car_owner) # 设备安装 保存GPS安装记录 r3 = json.loads(f.test_install_saveGpsInstallRecord(finance_id, gpsid, '', '1', '1', tf.getnow_day())) gps_finance_id = fs.get_gps_finance_id(gpsid, finance_id) a.verity(r3['data'], gps_finance_id) # 获取GPS安装记录详情 r4 = json.loads(f.test_install_getGpsInstallDetail(gps_finance_id)) a.verity(r4['data']['id'], gps_finance_id) a.verity(r4['data']['orgCode'], orgCode) a.verity(r4['data']['financeId'], finance_id) a.verity(r4['data']['gpsId'], gpsid) a.verity(r4['data']['gpsCode'], gpscode) a.verityIn(r4['data']['installDate'], str(tf.getnow_day())) # 根据所在机构获取GPS设备信息 f.test_install_getDeviceByOrgCode('', orgCode) # 更新GPS安装记录 f.test_install_updateGpsInstallRecord(finance_id, gpsid, gps_finance_id, '2', '2', tf.getnow_day()) # Gps安装记录列表 f.test_install_findGpsInstallRecord('', 1, 10) # 拆机,将gps安装记录拆除 f.test_install_dismantle(gps_finance_id) f.test_install_saveGpsInstallRecord(finance_id, gpsid, '', '1', '1', tf.getnow_day()) gps_finance_id = fs.get_gps_finance_id(gpsid, finance_id) # 删除安装记录,安装记录出错了,将错误数据删除 f.test_install_deleteRecord(gps_finance_id)
def test_013_warnhb(self): # 未回家/公司阀值设置 f.test_warnhb_saveThreshold(c.TRAVEL_OUT) # 未回家/公司阀值获取 r = json.loads(f.test_warnhb_getThreshold()) a.verity(r['data'], c.TRAVEL_OUT) # 查询停车记录 finance_id = fs.get_car_id(c.car_owner) warnid = fs.get_warn_id(warn_type='wh', financeid=finance_id) f.test_warnhb_getStations(warnid) # 查询用户住址信息 r1 = json.loads(f.test_warnhb_getFinanceInfo(finance_id)) a.verity(r1['data']['companyAddress'], fs.get_car_info(c.car_owner, 'company_address')) a.verity(r1['data']['companyCoord'], fs.get_car_info(c.car_owner, 'company_coord')) a.verity(r1['data']['ownerAddress'], fs.get_car_info(c.car_owner, 'owner_address')) a.verity(r1['data']['ownerCoord'], fs.get_car_info(c.car_owner, 'owner_coord')) # 查询未回家/公司报警 f.test_warnhb_getWarns('', 1, 10, 0) f.test_warnhb_getWarns('', 1, 10, 1)
def test_002_finance(self): # 查找组织机构 r1 = json.loads(f.test_finance_getOrgs()) a.verity(r1['data'][0]['orgCode'], orgCode, '断言orgCode') a.verity(r1['data'][0]['name'], c.companyName, '断言组织机构名称') # 查找还款方式 r2 = json.loads(f.test_finance_getRepayManner()) a.verity(r2['data'][0]['dictLevel'], 0, '断言dictLevel') a.verity(r2['data'][0]['name'], "等本等息", '断言还款方式') a.verity(r2['data'][0]['value'], "DBDX", '断言还款方式') a.verity(r2['data'][1]['dictLevel'], 0, '断言dictLevel') a.verity(r2['data'][1]['name'], "先息后本", '断言还款方式') a.verity(r2['data'][1]['value'], "XXHB", '断言还款方式') # 查找还款状态 r3 = json.loads(f.test_finance_getRepayStatus(2)) a.verity(r3['data'][0]['dictLevel'], 0, '断言dictLevel') a.verity(r3['data'][0]['name'], "还款中", '断言还款状态') a.verity(r3['data'][0]['value'], "HKZ", '断言还款状态') a.verity(r3['data'][1]['dictLevel'], 0, '断言dictLevel') a.verity(r3['data'][1]['name'], "已还清", '断言还款状态') a.verity(r3['data'][1]['value'], "YJQ", '断言还款状态') a.verity(r3['data'][2]['dictLevel'], 0, '断言dictLevel') a.verity(r3['data'][2]['name'], "未还款", '断言还款状态') a.verity(r3['data'][2]['value'], "WHK", '断言还款状态') # 查找贷款性质 r4 = json.loads(f.test_finance_getBorrowType()) a.verity(r4['data'][0]['dictLevel'], 0, '断言dictLevel') a.verity(r4['data'][0]['name'], "新增", '断言贷款性质') a.verity(r4['data'][0]['value'], "XZ", '断言贷款性质') a.verity(r4['data'][1]['dictLevel'], 0, '断言dictLevel') a.verity(r4['data'][1]['name'], "结清再贷", '断言贷款性质') a.verity(r4['data'][1]['value'], "JQZD", '断言贷款性质') a.verity(r4['data'][2]['dictLevel'], 0, '断言dictLevel') a.verity(r4['data'][2]['name'], "展期", '断言贷款性质') a.verity(r4['data'][2]['value'], "ZQ", '断言贷款性质') # 查看车牌号是否重复 r = json.loads(f.test_finance_alreadyHasCar(c.carNo, self.car_id)) a.verity(r['data']['alreadyHas'], 0) # 查找贷款性质 r5 = json.loads(f. test_finance_save(0, '', '', '', '', '', '', True, '', '', '', c.car_owner, 'DBDX', 1, '', 1, '四川省成都市武侯区桂溪街道天府大道北段', '104.068402,30.572893', '四川省成都市武侯区桂溪街道益州大道中段674号成都高新孵化园', '104.06432,30.572869', 'XZ', '', 1, '', '', '', c.carNo, orgCode, '13600000016')) self.car_id = fs.get_car_id(c.car_owner) a.verity(r5['data']['borrowType'], 'XZ', '断言贷款性质') a.verity(r5['data']['carNo'], c.carNo, '断言车牌号') a.verity(r5['data']['owner'], c.car_owner, '断言owner') a.verity(r5['data']['rePayManner'], 'DBDX', '断言还款方式') a.verity(r5['data']['orgCode'], orgCode, '断言orgCode') a.verity(r5['data']['id'], self.car_id, '断言车牌id') # 获取车贷数据列表 r6 = json.loads(f.test_finance_getFinances()) a.verity(r6['data']['pageNum'], 1, '断言pageNum') a.verity(r6['data']['pageSize'], 10, '断言pageSize') a.verityContain(r6['data']['record'], c.car_owner, '断言包含新增的车辆') # 获取车贷数据详情 r7 = json.loads(f.test_finance_getDetail(self.car_id)) a.verity(r7['data']['borrowType'], 'XZ', '断言贷款性质') a.verity(r7['data']['carNo'], c.carNo, '断言车牌号') a.verity(r7['data']['owner'], c.car_owner, '断言owner') a.verity(r7['data']['rePayManner'], 'DBDX', '断言还款方式') a.verity(r7['data']['orgCode'], orgCode, '断言orgCode') a.verity(r7['data']['id'], self.car_id, '断言车牌id') nowdate = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) # 逾期 / 还款, 逾期设置 r7 = json.loads(f.test_finance_overDue(nowdate, self.car_id, 0, 1)) a.verityTrue(r7['data'], '断言成功设置成了逾期') # 逾期/还款 ,还款完成 r8 = json.loads(f.test_finance_payOver(self.car_id, nowdate)) a.verityTrue(r8['data'], '断言成功设置还款完成') # 删除的车贷数据 r9 = json.loads(f.test_finance_deleteById(orgCode, self.car_id)) a.verity(r9['data'], 1, '断言成功设置成了逾期')