Пример #1
0
    def test_http_rpc_system_accept_help_delete_normal(self):
        """
         申请帮助流程测试,
         注意:如果要测试以下流程,mmm_da需要开启以下模式--apply_req second_1 --match second_11 --apply_pay second_21 --accept_req second_31 --day_seconds 1 --force_mtype system --enable_active False --enable_seal False  --enable_pay_check False
        :return:
        """
        new_id, new_passwd = new_account()
        new_token = new_access_token(new_id, new_passwd)

        apply_from_req_2_confirm_flow_auto(self, new_id, new_passwd, new_token)

        # 申请帮助方:申请接受帮助
        cur_mafuluo = get_mafuluo(new_id, new_token)
        accept_help_rsz = accept_help(MMMDAHttpRpcClt, new_id, new_token,
                                      random.randint(1, cur_mafuluo))
        self.assertTrue(accept_help_rsz['accept_help'])
        print "accept_help_rsz,", accept_help_rsz

        # 申请帮助方:删除接受帮助
        del_accept_help_result = del_accept_help(
            MMMDAHttpRpcClt, new_id, new_token,
            accept_help_rsz['accept_help']['accept_order'])
        print "del_accept_help_result,", del_accept_help_result

        # 申请帮助方:当前接受帮助
        cur_accept_help_result1 = cur_accept_help(MMMDAHttpRpcClt, new_id,
                                                  new_token)
        print "cur_accept_help_result1,", cur_accept_help_result1
        self.assertTrue(not cur_accept_help_result1['accept_help'])
Пример #2
0
    def test_http_rpc_accept_can_apply_normal(self):
        """
        接受帮助的同时可以申请帮助
         注意:如果要测试以下流程,mmm_da需要开启以下模式--apply_req second_1 --match second_11 --apply_pay second_21 --accept_req second_31 --day_seconds 1 --force_mtype system --enable_active False --enable_seal False  --enable_pay_check False
        :return:
        """
        new_id, new_passwd = new_account()
        new_token = new_access_token(new_id, new_passwd)

        # 申请帮助完成
        apply_from_req_2_confirm_flow_auto(self, new_id, new_passwd, new_token)

        # 申请帮助方:申请接受帮助, 不允许
        aft_apply_mafuluo = get_mafuluo(new_id, new_token)
        accept_help_rsz = accept_help(MMMDAHttpRpcClt, new_id, new_token,
                                      random.randint(1, aft_apply_mafuluo))
        self.assertTrue(accept_help_rsz['accept_help'])
        print "accept_help_rsz,", accept_help_rsz

        # 申请帮助
        apply_money = random_apply_money(new_id)
        apply_help_result = apply_help(MMMDAHttpRpcClt, new_id, new_token,
                                       apply_money)
        self.assertTrue(
            apply_help_result['result'] == error_code.ERROR_SUCCESS)
        print "apply_help_result,", apply_help_result
Пример #3
0
    def test_http_rpc_system_apply_help_normal(self):
        """
         申请帮助流程测试,
         注意:如果要测试以下流程,mmm_da需要开启以下模式--apply_req second_1 --match second_11 --apply_pay second_21 --accept_req second_31 --day_seconds 1 --force_mtype system --enable_active False --enable_seal False  --enable_pay_check False
        :return:
        """
        new_id, new_passwd = new_account()
        new_token = new_access_token(new_id, new_passwd)
        print "new_id,", new_id

        # 申请帮助方:申请提供帮助
        pre_apply_mafuluo = get_mafuluo(new_id, new_token)
        print "pre_apply_mafuluo,", pre_apply_mafuluo
        self.assertTrue(pre_apply_mafuluo == 0)

        apply_from_req_2_confirm_flow(self, new_id, new_passwd, new_token)

        aft_apply_mafuluo = get_mafuluo(new_id, new_token)
        print "aft_apply_mafuluo,", aft_apply_mafuluo
        self.assertTrue(aft_apply_mafuluo > pre_apply_mafuluo)

        # 申请帮助方:申请接受帮助
        accept_help_rsz = accept_help(MMMDAHttpRpcClt, new_id, new_token,
                                      random.randint(1, aft_apply_mafuluo))
        self.assertTrue(accept_help_rsz['accept_help'])
        print "accept_help_rsz,", accept_help_rsz

        # 申请帮助方:当前接受帮助
        cur_accept_help_result1 = cur_accept_help(MMMDAHttpRpcClt, new_id,
                                                  new_token)
        print "cur_accept_help_result1,", cur_accept_help_result1
        self.assertTrue('accept_help' in cur_accept_help_result1)

        # 请求等待排队
        time.sleep(SYNC_WAIT_TIME)

        # 申请帮助方:当前接受帮助
        cur_accept_help_result2 = cur_accept_help(MMMDAHttpRpcClt, new_id,
                                                  new_token)
        print "cur_accept_help_result2,", cur_accept_help_result2
        self.assertTrue('accept_help' in cur_accept_help_result2)
        self.assertTrue('apply_help_ls' in cur_accept_help_result2)
Пример #4
0
    def test_http_rpc_system_apply_help_reaccept(self):
        """
         申请帮助流程测试,
         注意:如果要测试以下流程,mmm_da需要开启以下模式--apply_req second_1 --match second_11 --apply_pay second_21 --accept_req second_31 --day_seconds 1 --force_mtype system --enable_active False --enable_seal False  --enable_pay_check False
        :return:
        """
        new_id, new_passwd = new_account()
        new_token = new_access_token(new_id, new_passwd)
        print "test_http_rpc_system_apply_help_reaccept, new_id,", new_id

        apply_from_req_2_confirm_flow_auto(self, new_id, new_passwd, new_token)
        apply_from_req_2_confirm_flow_auto(self, new_id, new_passwd, new_token)

        cur_mafuluo = get_mafuluo(new_id, new_token)

        # 申请帮助方:申请接受帮助
        accept_help_rsz = accept_help(MMMDAHttpRpcClt, new_id, new_token,
                                      random.randint(1, cur_mafuluo))
        print "accept_help_rsz,", accept_help_rsz