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
46430401
Commit
46430401
authored
Aug 25, 2021
by
张慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义专题商品列表接口
parent
312a0424
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
146 additions
and
21 deletions
+146
-21
visual_request.py
all_backend_api/visual_request.py
+11
-4
visual_request.yaml
all_backend_api/visual_request.yaml
+10
-6
path_setting.py
path_setting.py
+1
-1
test_service_list.py
test_backend_case/visual_case/test_service_list.py
+16
-5
service_list.yaml
test_backend_data/visual_data/service_list.yaml
+108
-5
No files found.
all_backend_api/visual_request.py
View file @
46430401
...
...
@@ -6,8 +6,15 @@ class visual_request(BaseRequest):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
VISUAL_CONFIG
)
# 签到--其他tab 美购feed
def
service_list
(
self
,
unit_id
,
current_city_id
=
'beijing'
):
# 签到--其他tab 美购feed
——自定义专题
def
service_list
(
self
,
unit_id
,
page
,
current_city_id
,
order_by
,
area
,
tag_ids
):
self
.
params
[
"unit_id"
]
=
unit_id
self
.
params
[
"page"
]
=
page
self
.
params
[
"current_city_id"
]
=
current_city_id
return
self
.
api_send
(
self
.
data
[
'service_list'
])
\ No newline at end of file
self
.
params
[
"order_by"
]
=
order_by
self
.
params
[
"area"
]
=
area
self
.
params
[
"tag_ids"
]
=
tag_ids
return
self
.
api_send
(
self
.
data
[
'service_list'
])
if
__name__
==
'__main__'
:
print
(
visual_request
()
.
service_list
(
20236
,
0
,
"beijing"
,
0
,
"worldwide"
,
[
66
]))
\ No newline at end of file
all_backend_api/visual_request.yaml
View file @
46430401
#签到--其他tab 美购feed
#签到--其他tab 美购feed
——自定义专题
service_list
:
method
:
GET
url
:
/api/visual/service_list
url
:
/api/visual/service_list
params
:
#组件id
unit_id
:
${unit_id}
current_city_id
:
${current_city_id}
unit_id
:
${unit_id}
page
:
${page}
current_city_id
:
${current_city_id}
order_by
:
${order_by}
area
:
${area}
tag_ids
:
${tag_ids}
data
:
{}
json
:
{}
is_Login
:
1
is_Login
:
1
\ No newline at end of file
path_setting.py
View file @
46430401
...
...
@@ -156,7 +156,7 @@ SIGN_EXCHANGED = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_dat
SIGN_CALENDAR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/user_data"
,
"sign_calendar.yaml"
)
# 签到--其他 tab feed --
也是总的 visual 配置项
# 签到--其他 tab feed --
自定义专题商品列表
VISUAL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"visual_request.yaml"
)
VISUAL_SERVICE_LIST
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/visual_data"
,
"service_list.yaml"
)
...
...
test_backend_case/visual_case/test_service_list.py
View file @
46430401
...
...
@@ -9,11 +9,21 @@ from in_common.base_request import BaseRequest
class
TestServiceList
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
VISUAL_SERVICE_LIST
)
service_list_case
,
service_list_data
=
get_ids
(
data
,
"service_list"
)
#
@pytest.mark.parametrize
(
"param"
,
service_list_data
,
ids
=
service_list_case
)
def
test_service_list
(
self
,
param
):
r
=
visual_request
()
.
service_list
(
param
[
"unit_id"
])
assert
r
[
"error"
]
==
0
list
=
r
.
get
(
"data"
)
.
get
(
"services"
,[])
assert
len
(
list
)
==
param
[
"len"
]
r
=
visual_request
()
.
service_list
(
param
[
"unit_id"
],
param
[
"page"
],
param
[
"current_city_id"
],
param
[
"order_by"
],
param
[
"area"
],
param
[
"tag_ids"
])
assert
r
[
"error"
]
==
param
[
"assert"
]
assert
len
(
r
[
"data"
][
"services"
])
>
0
assert
r
[
"data"
][
"services"
][
0
][
"spu_id"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"sku_id"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"doctor_hospital_name"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"gm_url"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"has_coupon"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"has_video"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"short_description"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"sell_num"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"price_info"
]
is
not
None
assert
r
[
"data"
][
"services"
][
0
][
"activity_tag"
]
is
not
None
\ No newline at end of file
test_backend_data/visual_data/service_list.yaml
View file @
46430401
#签到--其他tab 美购feed
#签到--其他tab 美购feed
——自定义专题
service_list
:
-
case
:
"
签到--其他tab
美购feed
校验返回数据数"
case
:
"
自定义专题商品列表-默认排序"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
0
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
len
:
10
unit_id
:
17923
\ No newline at end of file
-
case
:
"
自定义专题商品列表-城市筛选"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
0
area
:
"
592"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-品类筛选"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
0
area
:
"
worldwide"
tag_ids
:
[
66
]
assert
:
0
-
case
:
"
自定义专题商品列表-只能排序"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
9
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-销量最高"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
4
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-价格最低"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
5
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-价格最高"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
21
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-案例最多"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
7
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-离我最近"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
12
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-评价最高"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
13
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-召回数据正常"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
13
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
-
case
:
"
自定义专题商品列表-接口返回字段正常"
unit_id
:
20236
page
:
0
current_city_id
:
"
beijing"
order_by
:
13
area
:
"
worldwide"
tag_ids
:
[]
assert
:
0
\ 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