test_createBatch.py 1.12 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(str(d))
# print(d.replace())
# print(type(d),type(t))
print("\n开始运行订单创建脚本...\n")


#打印第三方请求json市场和请求次数
# print("请求参数={} 请求次数={}".format(d,t))


#根据用户参数进行请求
if d!=None :
    for i in range(t):
        body = d
        print("===================创建进门单,第{}次请求=================\n\n".format(i+1))
        print("请求url=={} \n\n\ 请求header=={},\n\n\ 请求body=={}\n\n".format(create.url,create.header,body))
        re = hg.post(url = create.url, headers = create.header, json = body)
        print("请求结果body=={}\n\n".format(re.json()))