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