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
305c886b
Commit
305c886b
authored
Aug 20, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更美榜单-机构榜、医生榜
parent
3ef455ce
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
131 additions
and
0 deletions
+131
-0
rank_request.py
all_backend_api/rank_request.py
+24
-0
rank_request.yaml
all_backend_api/rank_request.yaml
+18
-0
path_setting.py
path_setting.py
+9
-0
__init__.py
test_backend_case/rank_case/__init__.py
+0
-0
test_rank_doctor.py
test_backend_case/rank_case/test_rank_doctor.py
+23
-0
test_rank_hospital.py
test_backend_case/rank_case/test_rank_hospital.py
+19
-0
__init__.py
test_backend_data/rank_data/__init__.py
+0
-0
rank_doctor.yaml
test_backend_data/rank_data/rank_doctor.yaml
+19
-0
rank_hospital.yaml
test_backend_data/rank_data/rank_hospital.yaml
+19
-0
No files found.
all_backend_api/rank_request.py
0 → 100644
View file @
305c886b
import
path_setting
from
in_common.base_request
import
BaseRequest
class
rank_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
RANK_REQUEST_CONFIG
)
#更美榜单-机构榜
def
rank_hospital
(
self
,
city_id
,
version
,
device_id
=
'8C3EB981-B22D-43E2-B208-34F6036505BB'
):
self
.
params
[
"city_id"
]
=
city_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"rank_hospital"
])
#更美榜单-医生榜
def
rank_doctor
(
self
,
city_id
,
version
):
self
.
params
[
"city_id"
]
=
city_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"rank_doctor"
])
if
__name__
==
'__main__'
:
print
(
rank_request
()
.
rank_hospital
(
"beijing"
,
"748.0"
))
all_backend_api/rank_request.yaml
0 → 100644
View file @
305c886b
#更美榜单-机构榜
rank_hospital
:
method
:
GET
url
:
/api/rank/hospital
params
:
city_id
:
${city_id}
version
:
${version}
data
:
{}
json
:
{}
#更美榜单-医生榜
rank_doctor
:
method
:
GET
url
:
/api/rank/doctor
params
:
city_id
:
${city_id}
version
:
${version}
\ No newline at end of file
path_setting.py
View file @
305c886b
...
...
@@ -777,6 +777,15 @@ PROJECT_RANK = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data
#项目榜单-商品榜单排序
COMMODITY_RANK
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"commodity_rank.yaml"
)
#更美榜单
RANK_REQUEST_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"rank_request.yaml"
)
#更美榜单-机构榜
RANK_HOSPITAL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/rank_data"
,
"rank_hospital.yaml"
)
#更麽榜单-医生榜
RANK_DOCTOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/rank_data"
,
"rank_doctor.yaml"
)
...
...
test_backend_case/rank_case/__init__.py
0 → 100644
View file @
305c886b
test_backend_case/rank_case/test_rank_doctor.py
0 → 100644
View file @
305c886b
import
pytest
import
path_setting
from
all_backend_api.rank_request
import
rank_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestRankDoctor
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
RANK_DOCTOR
)
rank_doctor_case
,
rank_doctor_data
=
get_ids
(
data
,
"rank_doctor"
)
@pytest.mark.parametrize
(
"param"
,
rank_doctor_data
,
ids
=
rank_doctor_case
)
def
test_rank_doctor
(
self
,
param
):
r
=
rank_request
()
.
rank_doctor
(
param
[
"city_id"
],
param
[
"version"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"data"
][
0
][
"hospital"
]
.
find
(
param
[
'assert_city'
])
!=
param
[
"assert"
]
print
(
"更美榜单-医生榜接口已通"
)
else
:
assert
r
[
"data"
][
"data"
][
0
][
"hospital"
]
.
find
(
param
[
"assert_city"
])
==
param
[
"assert_error"
]
print
(
"更美榜单-医生榜,接口出错了"
)
test_backend_case/rank_case/test_rank_hospital.py
0 → 100644
View file @
305c886b
import
pytest
import
path_setting
from
all_backend_api.rank_request
import
rank_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestRankHospital
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
RANK_HOSPITAL
)
rank_hospital_case
,
rank_hospital_data
=
get_ids
(
data
,
"rank_hospital"
)
@pytest.mark.parametrize
(
"param"
,
rank_hospital_data
,
ids
=
rank_hospital_case
)
def
test_rank_hospital
(
self
,
param
):
r
=
rank_request
()
.
rank_hospital
(
param
[
"city_id"
],
param
[
"version"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"data"
][
0
][
"name"
]
.
find
(
param
[
"assert_city"
])
!=
param
[
"assert"
]
else
:
assert
r
[
"data"
][
"data"
][
0
][
"name"
]
.
find
(
param
[
"assert_city"
])
==
param
[
"assert_error"
]
test_backend_data/rank_data/__init__.py
0 → 100644
View file @
305c886b
test_backend_data/rank_data/rank_doctor.yaml
0 → 100644
View file @
305c886b
rank_doctor
:
#更美榜单-医生榜(北京)
-
case
:
"
更美榜单-医生榜(北京)"
city_id
:
beijing
version
:
748.0
assert_city
:
北京
assert
:
-1
assert_error
:
99
#更美榜单-医生榜(上海)
-
case
:
"
更美榜单-医生榜(上海)"
city_id
:
shanghai
version
:
748.0
assert_city
:
上海
assert
:
-1
assert_error
:
99
\ No newline at end of file
test_backend_data/rank_data/rank_hospital.yaml
0 → 100644
View file @
305c886b
rank_hospital
:
#更美榜单-机构榜(北京)
-
case
:
"
更美榜单-机构榜(北京)"
city_id
:
beijing
version
:
748.0
assert_city
:
北京
assert
:
-1
assert_error
:
99
#更美榜单-机构榜(上海)
-
case
:
"
更美榜单-机构榜(上海)"
city_id
:
shanghai
version
:
748.0
assert_city
:
上海
assert
:
-1
assert_error
:
99
\ 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