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
4d71699c
Commit
4d71699c
authored
Sep 27, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序-搜索结果页接口
parent
8dd25226
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
1 deletion
+72
-1
search_request.py
all_backend_api/search_request.py
+15
-1
search_request.yaml
all_backend_api/search_request.yaml
+13
-0
path_setting.py
path_setting.py
+3
-0
test_v2_service.py
test_backend_case/search_case/test_v2_service.py
+19
-0
v2_service.yaml
test_backend_data/search_data/v2_service.yaml
+22
-0
No files found.
all_backend_api/search_request.py
View file @
4d71699c
...
...
@@ -10,6 +10,7 @@ class search_request(BaseRequest):
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路径
self
.
data
=
self
.
api_load
(
path_setting
.
V2SERVICE_CONFIG
)
#小程序-搜索结果页
#搜索首页-热门搜索模块(点击搜索框即调接口)
def
keywords
(
self
,
current_city_id
,
search_tab
):
...
...
@@ -53,10 +54,23 @@ class search_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"hospital"
])
#小程序-搜索结果页
def
v2_service
(
self
,
q
,
input_type
,
version
,
page
,
start_num
):
self
.
params
[
"q"
]
=
q
self
.
params
[
"input_type"
]
=
input_type
self
.
params
[
"version"
]
=
version
self
.
params
[
"page"
]
=
page
self
.
params
[
"start_num"
]
=
start_num
return
self
.
api_send
(
self
.
data
[
"v2_service"
])
if
__name__
==
'__main__'
:
# 打印购物车-猜你喜欢列表接口返回
print
(
search_request
()
.
hospital
(
82
,
[],
"眼部整形"
,
10
,
"869378034450718"
))
#print(search_request().hospital(82, [], "眼部整形", 10, "869378034450718"))
# 小程序-搜索结果页
print
(
search_request
()
.
v2_service
(
"玻尿酸"
,
"4"
,
"7.36.0"
,
"1"
,
"0"
))
all_backend_api/search_request.yaml
View file @
4d71699c
...
...
@@ -50,3 +50,15 @@ hospital:
data
:
{}
json
:
{}
#小程序-搜索结果页
v2_service
:
method
:
get
url
:
/api/search/v2/service
params
:
q
:
${q}
input_type
:
${input_type}
version
:
${version}
page
:
${page}
start_num
:
${start_num}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
4d71699c
...
...
@@ -456,6 +456,9 @@ BEAUTY_CARD_ORDER_DETAIL_DATA = os.path.join(BASE_DIR, "backend_auto/test_backen
CONTENTV6_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
CONTENTV6
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"content_v6.yaml"
)
#小程序-搜索结果页
V2SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
V2SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"v2_service.yaml"
)
#品类聚合页面商品列表
TAG_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_request.yaml"
)
...
...
test_backend_case/search_case/test_v2_service.py
0 → 100644
View file @
4d71699c
import
pytest
import
path_setting
from
all_backend_api.search_request
import
search_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestV2Service
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
V2SERVICE
)
v2service_case
,
v2service_data
=
get_ids
(
data
,
"v2_service"
)
@pytest.mark.parametrize
(
"param"
,
v2service_data
,
ids
=
v2service_case
)
def
test_v2_service
(
self
,
param
):
r
=
search_request
()
.
v2_service
(
param
[
'q'
],
param
[
'input_type'
],
param
[
'version'
],
param
[
'page'
],
param
[
'start_num'
])
if
r
[
"error"
]
==
0
:
assert
len
(
r
[
"data"
][
"services"
])
==
param
[
"assert"
]
else
:
assert
r
[
"error"
]
==
param
[
"assert_error"
]
test_backend_data/search_data/v2_service.yaml
0 → 100644
View file @
4d71699c
v2_service
:
#小程序-搜索结果页
-
case
:
"
小程序端-搜索玻尿酸,正常召回搜索结果"
q
:
玻尿酸
input_type
:
4
version
:
7.36.0
page
:
1
start_num
:
0
assert
:
10
assert_error
:
"
接口报错啦"
-
case
:
"
小程序端-搜索呵呵,无结果召回"
q
:
呵呵
input_type
:
4
version
:
7.36.0
page
:
1
start_num
:
0
assert
:
0
assert_error
:
"
接口报错啦"
\ 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