Exemplo n.º 1
0
 def test2(self, case_des, host, doc, type, code, result, returnType,
           productType, orderAmount, clt, doc1, login):
     print('测试开始!')
     url = ''.join([host, doc])
     token = base.get_token_ok(doc1, login)
     a = token
     par = {
         'clt': clt,
         'returnType': returnType,
         'productType': productType,
         'token': token
     }
     # par = {'clt': 'h5Wealth', 'returnType': '151', 'productType': '340', 'token': '5c3fd464-d220-439f-a8c7-9ad624f30394'}
     resp = base.get_ProId(data=par)
     # print(resp)
     # dd = resp['data']
     # # print(dd)
     dd = resp['data'][3]['id']
     print(dd)
     par1 = {
         'clt': clt,
         'productId': dd,
         'orderAmount': orderAmount,
         'token': token
     }
     resp1 = base.method(url, method=type, data=par1)
     # print(resp1)
     self.assertEqual(resp1[code], result, msg='返回值错误')
     print('测试完成!')
Exemplo n.º 2
0
    def test1(self,case_des,host,doc,type,code,result,orderAmount,clt,doc1,login):
        # print('测试开始!')
        # host1 = 'https://api.haitoutech.com/haitou-user/user/'
        # doc1 = 'loginByEmail'
        # url1 = ''.join([host1, doc1])
        # data1 = {'email': '*****@*****.**', 'password': '******', 'userType': '1', 'clt': 'h5Wealth'}
        # r1 = requests.post(url1, data=data1,verify=False)
        # token = r1.json()["data"]
        # print(token)
        # par = {'clt':'h5Wealth','buyAmount':'100','certificationUrl':'/0fbe3e48ac1a41648db1ac726d078d78.png','token':token}
        # resp = requests.post(self.url1,data=par,verify=False)
        # print(resp)
        # dd = resp.json()['code']
        # print(dd)
        # self.assertEqual(dd,'0000',msg= '返回值错误')
        # print('测试完成!')
        print('测试开始!')

        token = base.get_token_ok(doc1,login)
        print(token)
        par = {'clt': clt,'orderAmount': orderAmount,'token':token,'certificationUrl':base.upload_file(token)}
        print(par)
        resp = requests.post(self.url1,data=par,verify=False).json()
        print(resp)
        dd = resp[code]
        print(dd)
        self.assertEqual(dd,result,msg= '返回值错误')
        print('测试完成!')
Exemplo n.º 3
0
 def test1(self, case_des, doc, type, code, result, returnType, productType,
           clt, doc1, login):
     print('测试开始!')
     # a = 'loginByEmail'
     # b = {'email': '*****@*****.**', 'password': '******', 'userType': '1', 'clt': 'h5Wealth'}
     host = self.host = read_Config.ReadConfig().get_config_str(
         'HOST', 'host')
     url = ''.join([host, doc])
     par = {
         'clt': clt,
         'returnType': returnType,
         'productType': productType,
         'token': base.get_token_ok(doc1, login)
     }
     resp = base.method(url, method=type, data=par)
     # print(resp)
     dd = resp['data']
     print(dd)
     aa = dd[1]['id']
     # infolist = []
     # for row in range(1,self.rows):
     #     info = self.sheet.row_values(row)
     #     infolist.append(info)
     print(aa)
     #self.assertTrue(resp[code] == result)
     self.assertEqual(resp[code], result, msg='返回值错误')
     print('测试完成!')
Exemplo n.º 4
0
 def test1(self, case_des, host, doc, type, code, result, clt, doc1, login):
     print('测试开始!')
     url = ''.join([self.host, doc])
     par = {'clt': clt, 'token': base.get_token_ok(doc1, login)}
     r = base.method(url, method=type, data=par)
     #resp = r.json()
     print(r)
     #self.assertTrue(resp[code] == result)
     self.assertEqual(r[code], result, msg='返回值错误')
     print('测试完成!')
Exemplo n.º 5
0
 def test1(self,case_des,host,doc,type,code,result,orderAmount,clt,doc1,login):
     print('测试开始!')
     url = ''.join([self.host, doc])
     token = base.get_token_ok(doc1,login)
     print(token)
     par = {'clt': clt,'orderAmount': orderAmount,'token':token,'certificationUrl':base.upload_file(token)}
     print(par)
     resp = requests.post(url,data=par,verify=False).json()
     print(resp)
     dd = resp[code]
     print(dd)
     self.assertEqual(dd,result,msg= '返回值错误')
     print('测试完成!')
Exemplo n.º 6
0
    def test1(self, case_des, host, doc, type, code, result, userType, clt,
              doc1, login):
        print('测试开始!')
        url = ''.join([self.host, doc])
        par = {'clt': clt, 'token': base.get_token_ok(doc1, login)}
        resp = base.method(url, method=type, data=par)
        print(resp)
        r1 = resp['data']['investorAuditStatus']
        self.assertEqual(resp[code], result, msg='返回值错误')
        # self.assertEqual(str(r1),userType,msg='用户返回类型不对')
        userType = int(userType)
        self.assertEqual(r1, userType, msg='用户返回类型不对')
        print(userType)

        print('测试完成!')
Exemplo n.º 7
0
 def test2(self, case_des, host, doc, doc2, type, code, result, returnType,
           productType, orderAmount, clt, doc1, login):
     print('测试开始!')
     url = ''.join([host, doc])
     url3 = ''.join([host, doc2])
     token = base.get_token_ok(doc1, login)
     par = {
         'clt': clt,
         'returnType': returnType,
         'productType': productType,
         'token': token
     }
     # par = {'clt': 'h5Wealth', 'returnType': '151', 'productType': '340', 'token': '5c3fd464-d220-439f-a8c7-9ad624f30394'}
     resp = base.get_ProId(data=par)
     # print(resp)
     # dd = resp['data']
     # # print(dd)
     dd = resp['data'][3]['id']
     print(dd)
     par2 = {
         'clt': clt,
         'productId': dd,
         'orderAmount': orderAmount,
         'balanceCurrencyType': 'USD',
         'token': token
     }
     resp2 = base.method(url, method=type, data=par2)
     print(resp2)
     # print(resp1)
     orderNo = resp2['data']['orderNo']
     print(orderNo)
     par3 = {
         'clt': clt,
         'productId': dd,
         'orderNo': orderNo,
         'token': token
     }
     print(par3)
     # resp3 = base.method(url3,method=type,data=par3)
     # print(resp3)
     self.assertEqual(resp[code], result, msg='返回值错误')
     print('测试完成!')