Commit 0836734c930262ccf27fdc50925fe791a3348e89

Authored by lixi
1 parent 80107c2d

上传用例

commons/api/hg/loan_vipCustomer/vipCustomerLoan_details.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +"""
  3 +@Time : 2021/8/31 14:43
  4 +@Auth : wlm
  5 +@File :createAndTrade.py
  6 +@IDE :PyCharm
  7 +"""
  8 +"""
  9 +大客户模式——新增交易单
  10 +"""
  11 +
  12 +from commons.MySession import hg
  13 +
  14 +class vipCustomerLoan_details():
  15 +
  16 + def __init__(self):
  17 + self.url = "http://test.gateway.diligrp.com:8285/hg-trading/api/vipCustomerLoan/details"
  18 + self.header = {
  19 + "Connection" :"keep-alive",
  20 + "Content-Length" :"130",
  21 + "Accept" :"application/json, text/plain, */*",
  22 + "UAP_accessToken" :"demo",
  23 + "ignoreCancelToken" :"true",
  24 + "UAP_refreshToken" :"demo",
  25 + "Content-Type" :"application/json;charset=UTF-8",
  26 + "Accept-Language" :"zh-CN,zh;q=0.9",
  27 + "Accept-Encoding" :"gzip, deflate"}
  28 + self.body = {"settleDate":"2021-09-07","customerId":141992,"tradeDateStart":"2021-09-07","tradeDateEnd":"2021-09-07"}
  29 +
  30 +
  31 +# tt = vipCustomerLoan_details()
  32 +# re = hg.post(url = tt.url,json = tt.body,headers = tt.header,proxies=hg.myproxies)
  33 +# print(re.json())
... ...
commons/api/hg/loan_vipCustomer/vipCustomerLoan_list.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +"""
  3 +@Time : 2021/8/31 14:43
  4 +@Auth : wlm
  5 +@File :createAndTrade.py
  6 +@IDE :PyCharm
  7 +"""
  8 +"""
  9 +大客户模式——新增交易单
  10 +"""
  11 +
  12 +from commons.MySession import hg
  13 +
  14 +class vipCustomerLoan_list():
  15 +
  16 + def __init__(self):
  17 + self.url = "http://test.gateway.diligrp.com:8285/hg-trading/api/vipCustomerLoan/list"
  18 + self.header = {
  19 + "Connection" :"keep-alive",
  20 + "Content-Length" :"130",
  21 + "Accept" :"application/json, text/plain, */*",
  22 + "UAP_accessToken" :"demo",
  23 + "ignoreCancelToken" :"true",
  24 + "UAP_refreshToken" :"demo",
  25 + "Content-Type" :"application/json;charset=UTF-8",
  26 + "Accept-Language" :"zh-CN,zh;q=0.9",
  27 + "Accept-Encoding" :"gzip, deflate"}
  28 + self.body = {
  29 + "current": 1,
  30 + "size": 10,
  31 + "customerId": 141992,
  32 + "customerAccountId": 107792,
  33 + "settleDateStart": "2021-09-07",
  34 + "settleDateEnd": "2021-09-07"}
  35 +
  36 +
  37 +tt = vipCustomerLoan_list()
  38 +re = hg.post(url = tt.url,json = tt.body,headers = tt.header,proxies=hg.myproxies)
  39 +print(re.json())
... ...
commons/api/hg/transaction/createAndTrade.py
... ... @@ -13,61 +13,56 @@ from commons import common as com
13 13 from commons.MySession import hg
14 14  
15 15 class createAndTrade():
16   - url = "http://test.gateway.diligrp.com:8285/hg-trading/api/tradingOrder/createAndTrade"
17   - header = {
18   - "UAP_accessToken":"demo",
19   - "UAP_refreshToken":"demo",
20   - "Content-Type":"application/json;charset=utf-8",
21   - "Host":"test.gateway.diligrp.com:8285",
22   - "Content-Length":"740"
23   - }
24   -
25   - body = {
26   - "sellerId":141962,
27   - "sellerName":"云康飞卖",
28   - "sellerAccountId":107663,
29   - "sellerCardNo":"888810062816",
30   - "buyerId":141966,
31   - "buyerName":"严永志买",
32   - "buyerAccountId":107675,
33   - "buyerCardNo":"888810055039",
34   - "posCode":"111222",
35   - "tradePassword":"111111",
36   - "orderItemList":[{
37   - "number":0,
38   - "batchCode":"2108000019",
39   - "productId":44,
40   - "productCode":"754107",
41   - "productName":"葡萄",
42   - "categoryId":754107,
43   - "weightType":1,
44   - "quantity":12,
45   - "pieceWeight":50,
46   - "grossWeight":0,
47   - "tareWeight":0,
48   - "weight":600,
49   - "price":200,
50   - "PriceStr":"2",
51   - "amount":2400,
52   - "amountStr":24.0,
53   - "originId":510100,
54   - "originName":"成都市",
55   - "feeItemList":[{
56   - "type":1,
57   - "chargeItemId":521,
58   - "chargeItemName":"买家手续费",
59   - "amount":2
60   - },{"type":2,
61   - "chargeItemId":522,
62   - "chargeItemName":"卖家手续费",
63   - "amount":12}]}
64   - ]
65   - }
66 16  
67 17 def __init__(self):
68   - self.url = createAndTrade.url
69   - self.header = createAndTrade.header
70   - self.body = createAndTrade.body
  18 + self.url = "http://test.gateway.diligrp.com:8285/hg-trading/api/tradingOrder/createAndTrade"
  19 + self.header = {
  20 + "UAP_accessToken":"demo",
  21 + "UAP_refreshToken":"demo",
  22 + "Content-Type":"application/json;charset=utf-8",
  23 + "Host":"test.gateway.diligrp.com:8285",
  24 + "Content-Length":"740"}
  25 + self.body = {
  26 + "sellerId":141962,
  27 + "sellerName":"云康飞卖",
  28 + "sellerAccountId":107663,
  29 + "sellerCardNo":"888810062816",
  30 + "buyerId":141966,
  31 + "buyerName":"严永志买",
  32 + "buyerAccountId":107675,
  33 + "buyerCardNo":"888810055039",
  34 + "posCode":"111222",
  35 + "tradePassword":"111111",
  36 + "orderItemList":[{
  37 + "number":0,
  38 + "batchCode":"2108000019",
  39 + "productId":44,
  40 + "productCode":"754107",
  41 + "productName":"葡萄",
  42 + "categoryId":754107,
  43 + "weightType":1,
  44 + "quantity":12,
  45 + "pieceWeight":50,
  46 + "grossWeight":0,
  47 + "tareWeight":0,
  48 + "weight":600,
  49 + "price":200,
  50 + "PriceStr":"2",
  51 + "amount":2400,
  52 + "amountStr":24.0,
  53 + "originId":510100,
  54 + "originName":"成都市",
  55 + "feeItemList":[{
  56 + "type":1,
  57 + "chargeItemId":521,
  58 + "chargeItemName":"买家手续费",
  59 + "amount":2
  60 + },{"type":2,
  61 + "chargeItemId":522,
  62 + "chargeItemName":"卖家手续费",
  63 + "amount":12}]}
  64 + ]
  65 + }
71 66  
72 67  
73 68 crat = createAndTrade()
... ...
testcase/hg/loan_vipCustomer/test_vipCustomerLoan_details.py 0 → 100644
  1 +#!/usr/bin/python
  2 +# -*- coding: UTF-8 -*-
  3 +import unittest
  4 +from commons import common as com
  5 +from commons.MySession import my,hg
  6 +from commons.api.hg.loan_vipCustomer.vipCustomerLoan_details import vipCustomerLoan_details
  7 +vip=vipCustomerLoan_details()
  8 +
  9 +
  10 +
  11 +class test_vipCustomerLoan_details(unittest.TestCase):
  12 + "杭果市场-借款管理-大客户借款"
  13 +
  14 + @unittest.case_mark(my.mark())
  15 + def test_vipCustomerLoan_details_01(self):
  16 + "大客户借款-详情:选择指定大客户借款数据,点击查看"
  17 + re=hg.post(url=vip.url,headers=vip.header,json=vip.body)
  18 + print(re.json())
  19 + self.assertEqual(re.status_code, 200)
  20 + self.assertTrue("'操作成功'" in str(re.json()).replace(" ",""))
  21 + self.assertTrue("'特朗普vip'" in str(re.json()).replace(" ",""))
  22 +
  23 +
  24 +if __name__ == "__main__":
  25 +
  26 + unittest.main(verbosity=2)
  27 +
  28 + # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01"))
... ...
testcase/hg/loan_vipCustomer/test_vipCustomerLoan_list.py 0 → 100644
  1 +#!/usr/bin/python
  2 +# -*- coding: UTF-8 -*-
  3 +import unittest
  4 +from commons import common as com
  5 +from commons.MySession import my,hg
  6 +from commons.api.hg.loan_vipCustomer.vipCustomerLoan_list import vipCustomerLoan_list
  7 +vip=vipCustomerLoan_list()
  8 +
  9 +
  10 +
  11 +class test_vipCustomerLoan_list(unittest.TestCase):
  12 + "杭果市场-借款管理-大客户借款"
  13 +
  14 + @unittest.case_mark(my.mark())
  15 + def test_vipCustomerLoan_list_01(self):
  16 + "大客户借款-查询:客户,卡号和结算日期查输入合法值,查询一条指定数据"
  17 + re=hg.post(url=vip.url,headers=vip.header,json=vip.body)
  18 + print(re.json())
  19 + self.assertEqual(re.status_code, 200)
  20 + self.assertTrue("'特朗普vip'" in str(re.json()).replace(" ",""))
  21 +
  22 +
  23 +if __name__ == "__main__":
  24 +
  25 + unittest.main(verbosity=2)
  26 +
  27 + # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01"))
... ...