mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 17:29:56 +08:00
fix: missing request json
This commit is contained in:
@@ -6,6 +6,11 @@
|
||||
|
||||
- feat: add sentry sdk
|
||||
|
||||
**Fixed**
|
||||
|
||||
- fix: missing request json
|
||||
- fix: override testsuite/testcase config verify
|
||||
|
||||
**Changed**
|
||||
|
||||
- change: add httprunner version in generated pytest file
|
||||
|
||||
@@ -175,6 +175,10 @@ def make_request_chain_style(request: Dict) -> Text:
|
||||
data = f'"{data}"'
|
||||
request_chain_style += f".with_data({data})"
|
||||
|
||||
if "json" in request:
|
||||
req_json = request["json"]
|
||||
request_chain_style += f".with_json({req_json})"
|
||||
|
||||
if "timeout" in request:
|
||||
timeout = request["timeout"]
|
||||
request_chain_style += f".set_timeout({timeout})"
|
||||
|
||||
@@ -215,6 +215,10 @@ class RequestWithOptionalArgs(object):
|
||||
self.__t_step.request.data = data
|
||||
return self
|
||||
|
||||
def with_json(self, req_json) -> "RequestWithOptionalArgs":
|
||||
self.__t_step.request.req_json = req_json
|
||||
return self
|
||||
|
||||
def set_timeout(self, timeout: float) -> "RequestWithOptionalArgs":
|
||||
self.__t_step.request.timeout = timeout
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user