Commit 357c53e7dc061bd77062d52ec3eda9cbfa816c92

Authored by lixi
1 parent 9b071ede

1

commons/MySession.py
... ... @@ -176,7 +176,7 @@ class mysession(requests.Session):
176 176 if "UAP_refreshToken" in kwargs["headers"].keys():
177 177 kwargs["headers"]["UAP_refreshToken"] = self.re.json()["data"]["refreshToken"]
178 178 if "UAP_firmId" in kwargs["headers"].keys():
179   - kwargs["headers"]["UAP_firmId"] = self.re.json()["data"]["user"]["firmId"]
  179 + kwargs["headers"]["UAP_firmId"] = str(self.re.json()["data"]["user"]["firmId"])
180 180 if "Host" in kwargs["headers"].keys():
181 181 kwargs["headers"]["Host"]=host
182 182 log.info("{}\n{}\n".format(url, kwargs))
... ...
testcase/hg/createBatch/test_createBatch.py
... ... @@ -4,10 +4,10 @@ import sys,os
4 4 #liunx的脚本路径位置
5 5 sys.path.extend(['/usr/jenkins/workspace/辅助脚本-创建交易单simple'])
6 6 from commons.MySession import hg
7   -from commons.basic.createAndTrade import createAndTrade
  7 +from commons.basic.registerRecord_save import registerRecord_save
8 8 from testcase.hg.createBatch.tmp_d import d
9 9 from testcase.hg.createBatch.tmp_t import t
10   -create = createAndTrade()
  10 +create = registerRecord_save()
11 11 # path = os.path.dirname(os.path.abspath(sys.argv[0]))
12 12 #查看文件有效路径
13 13 # print(sys.path)
... ... @@ -26,7 +26,7 @@ if d!=None :
26 26 for i in range(t):
27 27 body = d
28 28 print("创建订单,第{}次请求,请求body={}".format(i+1,body))
29   - re = hg.post(url = create.url, headers = create.header, json = body)
  29 + re = hg.post(url = create.url, headers = create.header, json = create.body)
30 30 print(re.json())
31 31  
32 32  
... ...