test_createBatch.py
1.02 KB
import sys
#windows的脚本路径位置
# sys.path.extend(['E:\\PycharmWorkspace\\test-scripts'])
#liunx的脚本路径位置
sys.path.extend(['/usr/jenkins/workspace/辅助脚本-创建进门批次单simple'])
from commons.MySession import hg
from commons.basic.registerRecord_save import registerRecord_save
from jmsf_d import d
from jmsf_t import t
create = registerRecord_save()
# path = os.path.dirname(os.path.abspath(sys.argv[0]))
#查看文件有效路径
# print(sys.path)
# print(type(d),type(t))
print("\n开始运行订单创建脚本...\n")
#打印第三方请求json市场和请求次数
print("请求参数={} 请求次数={}".format(d,t))
#根据用户参数进行请求
if d!=None :
for i in range(t):
body = d
print("创建订单,第{}次请求,请求body={}".format(i+1,body))
print("请求url={},请求header={},请求body={}".format(create.url,create.header,create.body))
re = hg.post(url = create.url, headers = create.header, json = create.body)
print(re.json())