Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jk_interface_test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangqiang
jk_interface_test
Commits
1f7f7795
Commit
1f7f7795
authored
Apr 14, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改响应
parent
dc4691da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
run_method.py
common/run_method.py
+5
-0
No files found.
common/run_method.py
View file @
1f7f7795
# coding:utf-8
# coding:utf-8
import
allure
import
requests
import
requests
import
json
import
json
from
json.decoder
import
JSONDecodeError
from
json.decoder
import
JSONDecodeError
from
common.common_config
import
common_config
from
common.common_config
import
common_config
from
urllib3.connectionpool
import
InsecureRequestWarning
from
urllib3.connectionpool
import
InsecureRequestWarning
import
urllib3
import
urllib3
urllib3
.
disable_warnings
(
InsecureRequestWarning
)
urllib3
.
disable_warnings
(
InsecureRequestWarning
)
...
@@ -41,9 +43,12 @@ class RunMethod:
...
@@ -41,9 +43,12 @@ class RunMethod:
res
=
res
.
json
()
res
=
res
.
json
()
except
JSONDecodeError
as
e
:
except
JSONDecodeError
as
e
:
res
=
{
"err_msg"
:
str
(
e
),
"res"
:
res
}
res
=
{
"err_msg"
:
str
(
e
),
"res"
:
res
}
allure
.
attach
(
body
=
json
.
dumps
(
res
,
ensure_ascii
=
False
),
name
=
'响应信息'
,
attachment_type
=
allure
.
attachment_type
.
JSON
)
return
res
except
Exception
as
e
:
except
Exception
as
e
:
res
=
{
"err_msg"
:
str
(
e
)}
res
=
{
"err_msg"
:
str
(
e
)}
# print(res)
# print(res)
allure
.
attach
(
body
=
json
.
dumps
(
res
.
json
(),
ensure_ascii
=
False
),
name
=
'响应信息'
,
attachment_type
=
allure
.
attachment_type
.
JSON
)
return
res
return
res
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment