def test_login(self):
     '''输入正确用户名和密码'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('..')
     params = dataparam.get_xls(proDir, 'UnionCar.xlsx', 'union_car')
     httpconf.set_url(params[0][2])
     httpconf.set_headers(params[0][3])
     httpconf.set_data(params[0][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                        httpconf.get_data(), httpconf.get_files(),
                        httpconf.get_timeout())
     print(rp.json()['message'])
 def test_A_right_computeFee(self):
     '''输入正确参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_FinanceProduct.xlsx', 'financeproduct')
     httpconf.set_url(params[8][2])
     httpconf.set_headers(params[8][3])
     httpconf.set_data(params[8][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()), httpconf.get_data(), httpconf.get_files(),
                      httpconf.get_timeout())
     #response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                  httpconf.get_timeout())
     print(rp.json())
 def test_A_right_getImageDict(self):
     '''输入正确参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_ApproveSystem.xlsx', 'approve')
     httpconf.set_url(params[0][2])
     httpconf.set_headers(params[0][3])
     httpconf.set_data(params[0][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                        httpconf.get_data(), httpconf.get_files(),
                        httpconf.get_timeout())
     # response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                  httpconf.get_timeout())
     print(rp.json()['message'])
Example #4
0
 def test_A_right_getProductInfos(self):
     '''输入正确参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_apply.xlsx', 'lzapply')
     httpconf.set_url(params[4][2])
     httpconf.set_headers(params[4][3])
     httpconf.set_data(params[4][4])
     rp = basehttp.post(httpconf.get_url(), Get_Token.Get_Token().get_headers(),
                        httpconf.get_data().encode("utf-8").decode("latin1"), httpconf.get_files(),
                        httpconf.get_timeout())
     # response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                  httpconf.get_timeout())
     print(rp.json()['status'])
     self.assertEqual('请求成功!', rp.json()['message'], msg='请求成功!')
Example #5
0
 def test_A_right_saveUpload(self):
     '''获取图片小类-输入正确参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_ApproveSystem.xlsx', 'approve')
     httpconf.set_url(params[4][2])
     httpconf.set_headers(params[4][3])
     httpconf.set_data(params[4][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                        httpconf.get_data(), httpconf.get_files(),
                        httpconf.get_timeout())
     # response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                  httpconf.get_timeout())
     print(rp.json()['status'])
     self.assertEqual(400, rp.json()['status'], msg='400错误!')
 def test_A_right_deletemassage(self):
     '''单个审批记录-输入正确参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_ApproveSystem.xlsx', 'approve')
     httpconf.set_url(params[10][2])
     httpconf.set_headers(params[10][3])
     httpconf.set_data(params[10][4])
     # rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
     #                    httpconf.get_data().encode('utf-8').decode('latin-1'),
     #                    httpconf.get_files(),
     #                    httpconf.get_timeout())
     # response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
     rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
                      httpconf.get_timeout())
     print(rp.json()['message'])
     self.assertEqual('请求成功!', rp.json()['message'], msg='请求成功!')
 def test_B_errorparam_getProductInfos(self):
     '''输入appType为空'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_FinanceProduct.xlsx', 'financeproduct')
     httpconf.set_url(params[1][2])
     httpconf.set_headers(params[1][3])
     httpconf.set_data(params[1][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()), httpconf.get_data(), httpconf.get_files(),
                      httpconf.get_timeout())
     # print(httpconf.get_url())
     # print(httpconf.get_headers())
     # print(httpconf.get_data())
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                   httpconf.get_timeout())
     print(rp.json()["message"])
     self.assertEqual('业务渠道不能为空\n', rp.json()['message'], msg='业务渠道不能为空\n')
 def test_A_right_getKrFeeRuleInfoByParms(self):
     '''输入正确参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'lz_FinanceProduct.xlsx',
                                'financeproduct')
     httpconf.set_url(params[6][2])
     httpconf.set_headers(params[6][3])
     httpconf.set_data(params[6][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                        httpconf.get_data(), httpconf.get_files(),
                        httpconf.get_timeout())
     #response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                  httpconf.get_timeout())
     print(rp.json()['message'])
     self.assertEqual('请求成功', rp.json()['message'], msg='请求成功')
Example #9
0
 def test_errorparam_getFunds(self):
     '''输入错误参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'Financing.xlsx', 'Finance')
     httpconf.set_url(params[1][2])
     httpconf.set_headers(params[1][3])
     httpconf.set_data(params[1][4])
     # rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()), httpconf.get_data(), httpconf.get_files(),
     #                  httpconf.get_timeout())
     # print(httpconf.get_url())
     # print(httpconf.get_headers())
     # print(httpconf.get_data())
     rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()),
                       eval(httpconf.get_headers()), httpconf.get_timeout())
     print(rp.json()["msg"])
     self.assertEqual('数据不存在', rp.json()['msg'], msg='数据不存在')
Example #10
0
    def test_righterror_getFunds(self):
        '''输入正确参数'''
        httpconf = BaseHttpConfig.BaseHttpConfig()
        dataparam = DataParamUtil.DataParamUtil()
        basehttp = BaseHttp.BaseHttp()
        proDir = os.path.abspath('../..')
        params = dataparam.get_xls(proDir, 'Financing.xlsx', 'Finance')
        httpconf.set_url(params[0][2])
        httpconf.set_headers(params[0][3])
        httpconf.set_data(params[0][4])
        # rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()), httpconf.get_data(), httpconf.get_files(),
        #                  httpconf.get_timeout())

        rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()),
                          eval(httpconf.get_headers()), httpconf.get_timeout())
        print(rp.json()["msg"])
        # # 查找有没有创建过相同BUG
        # jsonJira = self.jira.searchIssue("project=LZFINECAR and summary ~ 输入正确用户名密码登录失败", 0, 5)
        # # 获取BUG状态码
        # getIssueStatue = self.jira.GetIssueTransitionStatus(jsonJira[0])
        # # 如果之前存在BUG,已经修复,本次判断成功的话进行关闭
        # if rp.json()['message'] == '登录成功!':
        #     print(jsonJira[0])
        #     print(getIssueStatue[0]['id'])
        #     if getIssueStatue[0]['id'] == '701':
        #         # print('zzz')
        #         self.jira.updateTransition(jsonJira[0], 701)
        # # 如果之前的BUG没有修复,重新创建或者将已经存在的BUG重新打开
        # else:
        #     print(jsonJira)
        #     print(getIssueStatue[0]['id'])
        #     # 将BUG状态置成reopen
        #     if getIssueStatue[0]['id'] == '3' or getIssueStatue[0]['id'] == '701':
        #         # print('xxx')
        #         self.jira.updateTransition(jsonJira[0], 3)
        #     else:
        #         # pass
        #         # self.jira.login()
        #         # 创建一个新的BUG
        #         self.jira.createIssue('LZFINECAR', '输入正确用户名密码登录失败', '输入正确用户名密码登录失败', 'zhaozhaoxin')
        #         # self.assertEqual('登录成功!', rp.json()['message'], msg='登陆成功断言!')

        self.assertEqual('操作成功', rp.json()['msg'], msg='操作成功')
Example #11
0
 def test_B_errorparam_Anxinq_Register(self):
     '''输入错误参数-不产生合同'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'ContractImages.xlsx', 'contract')
     httpconf.set_url(params[7][2])
     httpconf.set_headers(params[7][3])
     httpconf.set_data(params[7][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                        httpconf.get_data(), httpconf.get_files(),
                        httpconf.get_timeout())
     # print(httpconf.get_url())
     # print(httpconf.get_headers())
     # print(httpconf.get_data())
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                   httpconf.get_timeout())
     print(rp.json())
     self.assertEqual('seqNo重复', rp.json()['message'], msg='seqNo重复')
Example #12
0
 def test_B_errorparam_getThumpUrl(self):
     '''输入错误参数'''
     httpconf = BaseHttpConfig.BaseHttpConfig()
     dataparam = DataParamUtil.DataParamUtil()
     basehttp = BaseHttp.BaseHttp()
     proDir = os.path.abspath('../..')
     params = dataparam.get_xls(proDir, 'ContractImages.xlsx', 'contract')
     httpconf.set_url(params[4][2])
     httpconf.set_headers(params[4][3])
     httpconf.set_data(params[4][4])
     rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                        httpconf.get_data(), httpconf.get_files(),
                        httpconf.get_timeout())
     # print(httpconf.get_url())
     # print(httpconf.get_headers())
     # print(httpconf.get_data())
     # rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
     #                   httpconf.get_timeout())
     print(rp.json()["message"])
     self.assertEqual('秘钥错误', rp.json()['message'], msg='请求异常!')
Example #13
0
    def test_A_right_getThumpUrl(self):
        '''输入正确参数'''
        httpconf = BaseHttpConfig.BaseHttpConfig()
        dataparam = DataParamUtil.DataParamUtil()
        basehttp = BaseHttp.BaseHttp()
        proDir = os.path.abspath('../..')
        params = dataparam.get_xls(proDir, 'ContractImages.xlsx', 'contract')
        httpconf.set_url(params[3][2])
        httpconf.set_headers(params[3][3])
        httpconf.set_data(params[3][4])

        rp = basehttp.post(httpconf.get_url(), eval(httpconf.get_headers()),
                           json.dumps(self.data.modify_getThumurl_params()),
                           httpconf.get_files(), httpconf.get_timeout())
        #response = requests.request("POST", httpconf.get_url(), data=httpconf.get_data(), headers=eval(httpconf.get_headers()))
        #rp = basehttp.get(httpconf.get_url(), eval(httpconf.get_data()), eval(httpconf.get_headers()),
        #                  httpconf.get_timeout())
        print(rp.json()['message'])

        self.assertEqual('请求成功!', rp.json()['message'], msg='请求成功!')