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
1c2399d6
Commit
1c2399d6
authored
Apr 16, 2021
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医院主页医生列表接口自动化
parent
d34c09be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
3 deletions
+102
-3
hospitals_request.py
all_backend_api/hospitals_request.py
+11
-2
hospitals_request.yaml
all_backend_api/hospitals_request.yaml
+11
-1
path_setting.py
path_setting.py
+2
-0
test_doctor.py
test_backend_case/hospitals_case/test_doctor.py
+28
-0
doctor.yaml
test_backend_data/hospitals_data/doctor.yaml
+50
-0
No files found.
all_backend_api/hospitals_request.py
View file @
1c2399d6
...
...
@@ -7,9 +7,18 @@ class hospitals_request(BaseRequest):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
HDYAML_CONFIG
)
#医院主页详情
def
detail
(
self
):
return
self
.
api_send
(
self
.
data
[
"detail"
])
#医院主页医生列表
def
doctor
(
self
):
return
self
.
api_send
(
self
.
data
[
"doctor"
])
if
__name__
==
'__main__'
:
print
(
hospitals_request
()
.
detail
())
\ No newline at end of file
#打印医院主页详情接口返回
print
(
hospitals_request
()
.
detail
())
#打印医院主页医生列表接口返回
print
(
hospitals_request
()
.
doctor
())
\ No newline at end of file
all_backend_api/hospitals_request.yaml
View file @
1c2399d6
#详情
detail
:
method
:
get
url
:
/api/hospitals/bjxyjcpfbyy/detail
params
:
{}
data
:
{}
json
:
{}
#医生列表
doctor
:
method
:
get
url
:
/api/hospitals/bjxyjcpfbyy/doctors
params
:
related
:
0
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
1c2399d6
...
...
@@ -10,6 +10,8 @@ LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data"
#医院主页详情
HDYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hospitals_request.yaml"
)
HOSPITAL_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_data"
,
"detail.yaml"
)
#医院主页医生列表
HOSPITAL_DOCTOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_data"
,
"doctor.yaml"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
HOSTYAML_CONFIG
)
test_backend_case/hospitals_case/test_doctor.py
0 → 100644
View file @
1c2399d6
import
pytest
from
all_backend_api.hospitals_request
import
hospitals_request
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
class
TestDoctor
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
HOSPITAL_DOCTOR
)
doctor_case
,
doctor_data
=
get_ids
(
data
,
"doctor"
)
@pytest.mark.parametrize
(
"param"
,
doctor_data
,
ids
=
doctor_case
)
def
test_doctor
(
self
,
param
):
r
=
hospitals_request
()
.
doctor
()
assert
r
[
"error"
]
==
param
[
"assert_error"
]
assert
r
[
"data"
][
0
][
"id"
]
==
param
[
"assert_id"
]
assert
r
[
"data"
][
0
][
"doctor_name"
]
==
param
[
"assert_name"
]
assert
r
[
"data"
][
0
][
"good_at"
][
0
]
==
param
[
"assert_good_at"
]
assert
r
[
"data"
][
0
][
"cases"
][
0
][
"name"
]
==
param
[
"assert_cases"
]
assert
r
[
"data"
][
0
][
"title"
]
==
param
[
"assert_title"
]
test_backend_data/hospitals_data/doctor.yaml
0 → 100644
View file @
1c2399d6
doctor
:
-
case
:
"
校验接口返回成功case"
assert_error
:
0
assert_id
:
"
ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name
:
"
赵希军"
assert_good_at
:
"
吸脂瘦身"
assert_cases
:
"
自体脂肪填充面部
80例"
assert_title
:
"
副主任"
-
case
:
"
校验医生id
case"
assert_error
:
0
assert_id
:
"
ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name
:
"
赵希军"
assert_good_at
:
"
吸脂瘦身"
assert_cases
:
"
自体脂肪填充面部
80例"
assert_title
:
"
副主任"
-
case
:
"
校验医生名称case"
assert_error
:
0
assert_id
:
"
ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name
:
"
赵希军"
assert_good_at
:
"
吸脂瘦身"
assert_cases
:
"
自体脂肪填充面部
80例"
assert_title
:
"
副主任"
-
case
:
"
校验医生明星项目case"
assert_error
:
0
assert_id
:
"
ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name
:
"
赵希军"
assert_good_at
:
"
吸脂瘦身"
assert_cases
:
"
自体脂肪填充面部
80例"
assert_title
:
"
副主任"
-
case
:
"
校验医生案例case"
assert_error
:
0
assert_id
:
"
ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name
:
"
赵希军"
assert_good_at
:
"
吸脂瘦身"
assert_cases
:
"
自体脂肪填充面部
80例"
assert_title
:
"
副主任"
-
case
:
"
校验医生title
case"
assert_error
:
0
assert_id
:
"
ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name
:
"
赵希军"
assert_good_at
:
"
吸脂瘦身"
assert_cases
:
"
自体脂肪填充面部
80例"
assert_title
:
"
副主任"
\ No newline at end of file
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