Example #1
0
 def test_add_loan(self, data, get_login_data, connect_mysql):
     login_data = get_login_data
     db = connect_mysql
     result = self.case_add_loan(data, login_data, db)
     HA().eq(data['expected']['code'], result['code'])
     HA().eq(data['expected']['msg'], result['msg'])
     if data['sql']:
         HA().eq(1, result['add_num'])
     logger.info('用例通过!')
 def test_recharge(self, data, get_login_data, connect_mysql):
     login_data = get_login_data
     db = connect_mysql
     result = self.case_recharge(data, login_data, db)
     HA().eq(data['expected']['code'], result['code'])
     HA().eq(data['expected']['msg'], result['msg'])
     if data['sql']:
         HA().eq(self.to_two_decimal(data['amount']), result['recharge'])
     logger.info('用例通过!')
Example #3
0
    def test_invest(self, data, get_login_data, connect_mysql):

        login_data = get_login_data
        db = connect_mysql
        result = self.case_invest(data, login_data, db)
        HA().eq(data['expected']['code'], result['code'])
        HA().eq(data['expected']['msg'], result['msg'])
        HA().eq(self.to_two_decimal(data['invest_json']['amount']), result['invest_amount'])
        if data['check_sql']:
            HA().eq(1, result['invest_num'])
            HA().eq(1, result['financeLog_num'])
        logger.info('用例通过!')
 def test_register(self, data):
     result = self.case_register(data['account'])
     HA().eq(data['expected']['code'], result['code'])
     HA().eq(data['expected']['msg'], result['msg'])
     logger.info('用例通过!')
 def test_login(self, data):
     result = self.login_api(**data['account']).json()
     HA().eq(data['expected']['code'], result['code'])
     HA().eq(data['expected']['msg'], result['msg'])
     logger.info('用例通过!')