def test_001_warnOfflineThreshold_getWarnOfflineThreshold(self):
     # 获取当前企业的阈值
     r1 = json.loads(f.test_warnOfflineThreshold_getWarnOfflineThreshold())
     a.verity(r1['data']['wireId'], 1, '断言wireId')
     a.verity(r1['data']['wiredThresholdHour'],
              fs.get_threshold(1)[0], '断言wiredThresholdHour')
     a.verity(r1['data']['wiredThresholdMinute'],
              fs.get_threshold(1)[1], '断言wireId')
     a.verity(r1['data']['wirelessId'], 2, '断言wireId')
     a.verity(r1['data']['wirelessThresholdHour'],
              fs.get_threshold(2)[0], '断言wirelessThresholdHour')
     a.verity(r1['data']['wirelessThresholdMinute'],
              fs.get_threshold(2)[1], '断言wirelessThresholdMinute')
     r2 = json.loads(
         f.test_warnOfflineThreshold_saveNewThreshold(
             1, 2, c.wiredThresholdHour, c.wiredThresholdMinute,
             c.wirelessThresholdHour, c.wirelessThresholdMinute))
     a.verityTrue(r2['data'])
     r = json.loads(f.test_warnOfflineThreshold_getWarnOfflineThreshold())
     a.verity(r['data']['wireId'], 1, '断言wireId')
     a.verity(r['data']['wiredThresholdHour'], c.wiredThresholdHour,
              '断言wiredThresholdHour')
     a.verity(r['data']['wiredThresholdMinute'], c.wiredThresholdMinute,
              '断言wireId')
     a.verity(r['data']['wirelessId'], 2, '断言wireId')
     a.verity(r['data']['wirelessThresholdHour'], c.wirelessThresholdHour,
              '断言wirelessThresholdHour')
     a.verity(r['data']['wirelessThresholdMinute'],
              c.wirelessThresholdMinute, '断言wirelessThresholdMinute')
 def test_011_api_78dk_clientapp_common_sys_androidIsOnline(self):
     """
       Time       :2019-04-25
       author     : 罗林
       desc       : andriod上架标识
     """
     rs = ea_app.test_api_78dk_clientapp_common_sys_androidIsOnline()
     ass.verity(json.loads(rs)['code'], "10000")
     ass.verityContain(json.loads(rs)['data'], "online")
     ass.verityTrue(json.loads(rs)['data']['online'])
Beispiel #3
0
def assert_result(result_data):
    """
    结果内部数据检查
    :param result_data:
    :return:
    """
    orig = result_data['score_data']['original_score_dict']
    stat = result_data['score_data']['score_stat_dict']
    sum_score = lambda x: sum(x.values())
    sum_all = lambda x: sum([sum(y.values()) for y in x.values()])
    Assertion.verity(stat['application']['1m_score'],
                     sum_score(orig['application']['1m']))
    Assertion.verity(stat['application']['3m_score'],
                     sum_score(orig['application']['3m']))
    Assertion.verity(stat['application']['6m_score'],
                     sum_score(orig['application']['6m']))
    Assertion.verity(stat['application']['7_12m_score'],
                     sum_score(orig['application']['7_12m']))
    Assertion.verity(stat['application']['7d_score'],
                     sum_score(orig['application']['7d']))
    Assertion.verity(stat['application_score'], sum_all(orig['application']))
    Assertion.verity(stat['application_score'], sum_score(stat['application']))
    Assertion.verity(stat['blacklist_score'], sum_score(orig['blacklist']))
    Assertion.verity(stat['loanAndReject']['1m_score'],
                     sum_score(orig['loanAndReject']['1m']))
    Assertion.verity(stat['loanAndReject']['3m_score'],
                     sum_score(orig['loanAndReject']['3m']))
    Assertion.verity(stat['loanAndReject']['6m_score'],
                     sum_score(orig['loanAndReject']['6m']))
    Assertion.verity(stat['loanAndReject']['7_12m_score'],
                     sum_score(orig['loanAndReject']['7_12m']))
    Assertion.verity(stat['loanAndReject']['7d_score'],
                     sum_score(orig['loanAndReject']['7d']))
    Assertion.verity(stat['loanAndReject_score'],
                     sum_all(orig['loanAndReject']))
    Assertion.verity(stat['loanAndReject_score'],
                     sum_score(stat['loanAndReject']))
    Assertion.verity(stat['overdue_score'], sum_score(orig['overdue']))
    Assertion.verity(stat['registration']['1m_score'],
                     sum_score(orig['registration']['1m']))
    Assertion.verity(stat['registration']['3m_score'],
                     sum_score(orig['registration']['3m']))
    Assertion.verity(stat['registration']['6m_score'],
                     sum_score(orig['registration']['6m']))
    Assertion.verity(stat['registration']['7_12m_score'],
                     sum_score(orig['registration']['7_12m']))
    Assertion.verity(stat['registration']['7d_score'],
                     sum_score(orig['registration']['7d']))
    Assertion.verity(stat['registration_score'], sum_all(orig['registration']))
    Assertion.verity(stat['registration_score'],
                     sum_score(stat['registration']))
    Assertion.verity(stat['final_score'],
                     (stat['application_score'] + stat['blacklist_score'] +
                      stat['loanAndReject_score'] + stat['overdue_score'] +
                      stat['registration_score']))
    final_score, risk_suggest = stat['final_score'], stat['risk_suggest']
    Assertion.verityTrue(0 <= final_score <= 840)
    if 0 <= final_score <= 60:
        Assertion.verity(risk_suggest, "建议通过")
    elif 61 <= final_score <= 120:
        Assertion.verity(risk_suggest, "建议人工审核")
    elif final_score >= 121:
        Assertion.verity(risk_suggest, "建议拒绝")
Beispiel #4
0
 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, '断言成功设置成了逾期')