Commit bbaea49fb3456f491e8bffc5426f506378bbadc3

Authored by lixi
1 parent 28f9f414

1

testcase/hg/createTradingOrder/test_createTradingOrder.py
1 1 import sys,os
2   -# sys.path.extend(['E:\\PycharmWorkspace\\test-scripts'])
  2 +#windows
  3 +sys.path.extend(['E:\\PycharmWorkspace\\test-scripts'])
  4 +#liunx
3 5 sys.path.extend(['/usr/jenkins/workspace/辅助脚本-创建交易单simple'])
4 6 import commons as com
5 7 from commons.MySession import hg
6 8 from commons.basic.createAndTrade import createAndTrade
7 9 from tmp import d
8 10 create = createAndTrade()
9   -
10   -
11 11 # path = os.path.dirname(os.path.abspath(sys.argv[0]))
12   -print(sys.path)
  12 +#查看文件有效路径
  13 +# print(sys.path)
  14 +
  15 +print("\n开始运行订单创建脚本...\n")
13 16  
14 17  
15   -#打印请求json
  18 +#打印第三方请求json
16 19 print(d)
17 20  
18   -#获取命令行参数
  21 +#获取命令行参数,市场和请求次数
19 22 cmd_list=sys.argv[1:]
20 23 print(cmd_list)
21 24  
... ... @@ -27,10 +30,10 @@ if len(cmd_list)!=0:
27 30 # print("请求次数{}".format(cmd_list[2]))
28 31  
29 32  
30   -if d!="None":
  33 +if d!="None" and len(cmd_list)!=0:
31 34 for i in range(int(cmd_list[1])):
32 35 body = d
33   - print("创建订单body",body)
  36 + print("创建订单,第{}次请求,请求body={}".format(i+1,body))
34 37 re = hg.post(url = create.url, headers = create.header, json = body)
35 38 print(re.json())
36 39  
... ...