Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
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
邓莹莹
backend_auto
Commits
0f73d12f
Commit
0f73d12f
authored
Jun 28, 2021
by
邓莹莹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交公共方法的修改,主要针对不同服务直接域名切换的
parent
ecc83e8f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
48 deletions
+11
-48
host.yaml
host.yaml
+3
-3
base_request.py
in_common/base_request.py
+1
-1
login_session_function.py
login_session_function.py
+6
-43
topic_reply_create.yaml
test_backend_data/topic_data/topic_reply_create.yaml
+1
-1
No files found.
host.yaml
View file @
0f73d12f
develop_host
:
backend
:
http://backend.paas-develop.env
#
om: http://om.paas-develop.env
#
doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
om
:
http://om.paas-develop.env
doctor
:
http://doctor.paas-develop.env
# backend
_online
: https://backend.igengmei.com
in_common/base_request.py
View file @
0f73d12f
...
...
@@ -59,7 +59,7 @@ class BaseRequest:
s
=
requests
if
req
.
get
(
'isLogin'
):
s
=
LoginFunction
()
.
get_session
()
s
=
LoginFunction
()
.
get_session
(
host_service
)
# 调用具体case的url
r
=
s
.
request
(
...
...
login_session_function.py
View file @
0f73d12f
...
...
@@ -15,56 +15,20 @@ class LoginFunction:
with
open
(
path
,
encoding
=
'utf-8'
)
as
f
:
return
yaml
.
safe_load
(
f
)
def
get_session
(
self
):
hostList
=
self
.
host
[
'develop_host'
]
for
key
in
hostList
:
if
'backend'
==
key
:
return
self
.
get_develop_session
()
if
'doctor'
==
key
:
return
self
.
get_doctor_session
()
elif
'om'
==
key
:
return
self
.
get_om_session
()
def
get_develop_session
(
self
):
url
=
self
.
host
[
"develop_host"
][
"backend"
]
+
self
.
params
[
"backend_login"
][
"url"
]
def
get_session
(
self
,
host_service
):
project_login
=
host_service
+
"_login"
url
=
self
.
host
[
"develop_host"
][
host_service
]
+
self
.
params
[
project_login
][
"url"
]
s
=
requests
.
session
()
r
=
s
.
request
(
self
.
params
[
"backend_login"
][
"method"
],
self
.
params
[
project_login
][
"method"
],
url
=
url
,
params
=
self
.
params
[
"backend_login"
][
"params"
],
data
=
self
.
params
[
"backend_login"
][
"data"
],
params
=
self
.
params
[
project_login
][
"params"
],
data
=
self
.
params
[
project_login
][
"data"
],
headers
=
{
'Connection'
:
'close'
},
# verify=False
)
return
s
def
get_doctor_session
(
self
):
url
=
self
.
host
[
"develop_host"
][
"doctor"
]
+
self
.
params
[
"doctor_login"
][
"url"
]
s
=
requests
.
session
()
r
=
s
.
request
(
self
.
params
[
"doctor_login"
][
"method"
],
url
=
url
,
params
=
self
.
params
[
"doctor_login"
][
"params"
],
data
=
self
.
params
[
"doctor_login"
][
"data"
],
headers
=
{
'Connection'
:
'close'
}
)
return
s
def
get_om_session
(
self
):
url
=
self
.
host
[
"develop_host"
][
"om"
]
+
self
.
params
[
"om_login"
][
"url"
]
s
=
requests
.
session
()
r
=
s
.
request
(
self
.
params
[
"om_login"
][
"method"
],
url
=
url
,
params
=
self
.
params
[
"om_login"
][
"params"
],
data
=
self
.
params
[
"om_login"
][
"data"
],
headers
=
{
'Connection'
:
'close'
}
)
return
s
if
__name__
==
'__main__'
:
LoginFunction
()
.
get_session
()
\ No newline at end of file
test_backend_data/topic_data/topic_reply_create.yaml
View file @
0f73d12f
...
...
@@ -3,7 +3,7 @@ reply_create:
beuzhu
:
'
#
备注:
这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case
:
日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel
:
benzhan
content
:
ces测试+2021-06-2
3 11:41:50
content
:
ces测试+2021-06-2
8 16:25:25
message
:
请勿回复重复内容
message1
:
回复成功
message2
:
你的回复有点频繁,稍后再来
...
...
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