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
754c7d16
Commit
754c7d16
authored
Jun 07, 2021
by
张淑琴
Browse files
Options
Browse Files
Download
Plain Diff
提交代码
parents
f160b71e
e8662fa0
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
144 additions
and
2 deletions
+144
-2
filter_request.py
all_backend_api/filter_request.py
+23
-0
filter_request.yaml
all_backend_api/filter_request.yaml
+11
-0
search_request.py
all_backend_api/search_request.py
+18
-0
search_request.yaml
all_backend_api/search_request.yaml
+15
-2
path_setting.py
path_setting.py
+8
-0
__init__.py
test_backend_case/filter_case/__init__.py
+0
-0
test_service_home_city_v2.py
test_backend_case/filter_case/test_service_home_city_v2.py
+19
-0
test_hospital.py
test_backend_case/search_case/test_hospital.py
+19
-0
__init__.py
test_backend_data/filter_data/__init__.py
+0
-0
service_home_city_v2.yaml
test_backend_data/filter_data/service_home_city_v2.yaml
+14
-0
hospital.yaml
test_backend_data/search_data/hospital.yaml
+17
-0
No files found.
all_backend_api/filter_request.py
0 → 100644
View file @
754c7d16
import
path_setting
from
in_common.base_request
import
BaseRequest
class
filter_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
FILTER_CONFIG
)
def
service_home_city_v2
(
self
,
current_city_id
,
lat
,
lng
):
print
(
"fgx"
)
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"lat"
]
=
lat
self
.
params
[
"lng"
]
=
lng
return
self
.
api_send
(
self
.
data
[
"service_home_city_v2"
])
if
__name__
==
'__main__'
:
#城市筛选器
print
(
filter_request
()
.
service_home_city_v2
(
""
,
"40.002"
,
"116.487252"
))
print
(
"fgx"
)
all_backend_api/filter_request.yaml
0 → 100644
View file @
754c7d16
service_home_city_v2
:
method
:
GET
url
:
/api/filter/service_home_city_v2
params
:
current_city_id
:
${current_city_id}
lat
:
${lat}
lng
:
${lng}
data
:
{}
json
:
{}
all_backend_api/search_request.py
View file @
754c7d16
...
...
@@ -4,6 +4,9 @@ from in_common.base_request import BaseRequest
class
search_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
KEYWORDS_CONFIG
)
#品类聚合页面医生tab列表
self
.
data
=
self
.
api_load
(
path_setting
.
HOSPITAL_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
KEYWORDS_CONFIG
)
#keywords路径
self
.
data
=
self
.
api_load
(
path_setting
.
CONTENTV6_CONFIG
)
#content_v6路径
self
.
data
=
self
.
api_load
(
path_setting
.
HOT_CONFIG
)
# hot路径
...
...
@@ -38,3 +41,18 @@ class search_request(BaseRequest):
def
hot
(
self
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"hot"
])
# 品类聚合页面医生tab列表
def
hospital
(
self
,
cp_id
,
tag_id
,
q
,
count
,
device_id
):
self
.
params
[
"cp_id"
]
=
cp_id
self
.
params
[
"tag_id"
]
=
tag_id
self
.
params
[
"q"
]
=
q
self
.
params
[
"count"
]
=
count
self
.
params
[
"device_id"
]
=
device_id
return
self
.
api_send
(
self
.
data
[
"hospital"
])
if
__name__
==
'__main__'
:
# 打印购物车-猜你喜欢列表接口返回
print
(
search_request
()
.
hospital
(
82
,
[],
"眼部整形"
,
10
,
"869378034450718"
))
all_backend_api/search_request.yaml
View file @
754c7d16
...
...
@@ -35,4 +35,17 @@ hot:
url
:
/api/search/hot
#列出所有定义函数时的参数
params
:
version
:
${version}
\ No newline at end of file
version
:
${version}
#品类聚合页面医生tab列表
hospital
:
method
:
get
url
:
/api/search/v2/hospital
params
:
cp_id
:
${cp_id}
tag_id
:
${tag_id}
q
:
${q}
count
:
${count}
device_id
:
${device_id}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
754c7d16
...
...
@@ -241,6 +241,14 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
#回答详情页
DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"answer_request.yaml"
)
DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/answer_data"
,
"detail.yaml"
)
#品类聚合页面医生tab列表
HOSPITAL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
HOSPITAL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"hospital.yaml"
)
#城市筛选器
FILTER_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"filter_request.yaml"
)
FILTER
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/filter_data"
,
"service_home_city_v2.yaml"
)
#医生后台-全部私信列表
CONVERSATION
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation.yaml"
)
...
...
test_backend_case/filter_case/__init__.py
0 → 100644
View file @
754c7d16
test_backend_case/filter_case/test_service_home_city_v2.py
0 → 100644
View file @
754c7d16
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.filter_request
import
filter_request
class
TestServiceHomeCityV2
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FILTER
)
servicehomecityv2_case
,
servicehomecityv2_data
=
get_ids
(
data
,
"service_home_city_v2"
)
@pytest.mark.parametrize
(
"param"
,
servicehomecityv2_data
,
ids
=
servicehomecityv2_case
)
def
test_service_home_city_v2
(
self
,
param
):
r
=
filter_request
()
.
service_home_city_v2
(
param
[
"current_city_id"
],
param
[
"lat"
],
param
[
"lng"
])
# print('feng=', r)
if
r
[
"error"
]
==
0
:
assert
len
(
r
[
"data"
][
"area"
])
>
0
test_backend_case/search_case/test_hospital.py
0 → 100644
View file @
754c7d16
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.search_request
import
search_request
class
TestHospital
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
HOSPITAL
)
hospital_case
,
hospital_data
=
get_ids
(
data
,
"hospital"
)
@pytest.mark.parametrize
(
"param"
,
hospital_data
,
ids
=
hospital_case
)
def
test_hospital
(
self
,
param
):
r
=
search_request
()
.
hospital
(
param
[
"cp_id"
],
param
[
"tag_id"
],
param
[
"q"
],
param
[
"count"
],
param
[
"device_id"
])
# print('feng=', r)
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
]
!=
param
[
"assert"
]
test_backend_data/filter_data/__init__.py
0 → 100644
View file @
754c7d16
test_backend_data/filter_data/service_home_city_v2.yaml
0 → 100644
View file @
754c7d16
#城市筛选器
service_home_city_v2
:
-
case
:
"
城市筛选器接口"
current_city_id
:
"
"
lat
:
"
40.002"
lng
:
"
116.487252"
assert
:
0
test_backend_data/search_data/hospital.yaml
0 → 100644
View file @
754c7d16
hospital
:
#品类聚合页医生tab
-
case
:
"
品类聚合页面医生tab"
assert
:
null
cp_id
:
82
tag_id
:
[]
q
:
"
眼部整形"
count
:
10
device_id
:
869378034450718
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