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
b70d82a4
Commit
b70d82a4
authored
Aug 27, 2021
by
张慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义专题接口
parent
46430401
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
7 deletions
+102
-7
visual_request.py
all_backend_api/visual_request.py
+18
-4
visual_request.yaml
all_backend_api/visual_request.yaml
+20
-3
path_setting.py
path_setting.py
+2
-0
test_page_detail.py
test_backend_case/visual_case/test_page_detail.py
+22
-0
test_unit_filter.py
test_backend_case/visual_case/test_unit_filter.py
+20
-0
page_detail.yaml
test_backend_data/visual_data/page_detail.yaml
+10
-0
unit_filter.yaml
test_backend_data/visual_data/unit_filter.yaml
+10
-0
No files found.
all_backend_api/visual_request.py
View file @
b70d82a4
...
...
@@ -6,7 +6,12 @@ class visual_request(BaseRequest):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
VISUAL_CONFIG
)
# 签到--其他tab 美购feed——自定义专题
# 自定义专题详情
def
page_detail
(
self
,
page_id
):
self
.
params
[
"page_id"
]
=
page_id
return
self
.
api_send
(
self
.
data
[
"page_detail"
])
# 签到--其他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
...
...
@@ -14,7 +19,17 @@ class visual_request(BaseRequest):
self
.
params
[
"order_by"
]
=
order_by
self
.
params
[
"area"
]
=
area
self
.
params
[
"tag_ids"
]
=
tag_ids
return
self
.
api_send
(
self
.
data
[
'service_list'
])
return
self
.
api_send
(
self
.
data
[
"service_list"
])
# 自定义专题-筛选器
def
unit_filter
(
self
,
unit_id
):
self
.
params
[
"unit_id"
]
=
unit_id
return
self
.
api_send
(
self
.
data
[
"unit_filter"
])
if
__name__
==
'__main__'
:
print
(
visual_request
()
.
service_list
(
20236
,
0
,
"beijing"
,
0
,
"worldwide"
,
[
66
]))
\ No newline at end of file
# 自定义专题详情
# print(visual_request().page_detail(903))
# 自定义专题商品列表
# print(visual_request().service_list(20236, 0, "beijing", 0, "worldwide", [66]))
# 自定义专题筛选器
print
(
visual_request
()
.
unit_filter
(
20236
))
all_backend_api/visual_request.yaml
View file @
b70d82a4
#签到--其他tab 美购feed——自定义专题
#自定义专题详情
page_detail
:
method
:
get
url
:
/api/visual/page/detail
params
:
page_id
:
${page_id}
data
:
{}
json
:
{}
#签到--其他tab 美购feed——自定义专题商品列表
service_list
:
method
:
GET
url
:
/api/visual/service_list
...
...
@@ -11,4 +20,12 @@ service_list:
tag_ids
:
${tag_ids}
data
:
{}
json
:
{}
is_Login
:
1
\ No newline at end of file
#自定义专题筛选器
unit_filter
:
method
:
get
url
:
/api/visual/unit_filter
params
:
unit_id
:
${unit_id}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
b70d82a4
...
...
@@ -159,6 +159,8 @@ SIGN_CALENDAR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data
# 签到--其他 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"
)
VISUAL_UNIT_FILTER
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/visual_data"
,
"unit_filter.yaml"
)
VISUAL_PAGE_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/visual_data"
,
"page_detail.yaml"
)
#搜索首页-热门搜索
...
...
test_backend_case/visual_case/test_page_detail.py
0 → 100644
View file @
b70d82a4
import
pytest
import
path_setting
from
all_backend_api.visual_request
import
visual_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestPageDetail
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
VISUAL_PAGE_DETAIL
)
page_detail_case
,
page_detail_data
=
get_ids
(
data
,
"page_detail"
)
@pytest.mark.parametrize
(
"param"
,
page_detail_data
,
ids
=
page_detail_case
)
def
test_page_detail
(
self
,
param
):
r
=
visual_request
()
.
page_detail
(
param
[
"page_id"
])
assert
r
[
"error"
]
==
param
[
"assert"
]
assert
len
(
r
[
"data"
][
"unit_list"
])
>
0
assert
r
[
"data"
][
"area"
]
is
not
None
assert
r
[
"data"
][
"id"
]
is
not
None
assert
r
[
"data"
][
"share_data"
]
is
not
None
assert
r
[
"data"
][
"name"
]
is
not
None
test_backend_case/visual_case/test_unit_filter.py
0 → 100644
View file @
b70d82a4
import
pytest
import
path_setting
from
all_backend_api.visual_request
import
visual_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestUnitFilter
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
VISUAL_UNIT_FILTER
)
unit_filter_case
,
unit_filter_data
=
get_ids
(
data
,
"unit_filter"
)
@pytest.mark.parametrize
(
"param"
,
unit_filter_data
,
ids
=
unit_filter_case
)
def
test_unit_filter
(
self
,
param
):
r
=
visual_request
()
.
unit_filter
(
param
[
"unit_id"
])
assert
r
[
"error"
]
==
param
[
"assert"
]
assert
r
[
"data"
][
"field"
]
is
not
None
assert
r
[
"data"
][
"order"
]
is
not
None
assert
r
[
"data"
][
"areas"
]
is
not
None
test_backend_data/visual_data/page_detail.yaml
0 → 100644
View file @
b70d82a4
page_detail
:
-
case
:
"
自定义专题详情接口调用成功case"
page_id
:
903
assert
:
0
-
case
:
"
自定义专题详情接口返回数据正常case"
page_id
:
903
assert
:
0
\ No newline at end of file
test_backend_data/visual_data/unit_filter.yaml
0 → 100644
View file @
b70d82a4
unit_filter
:
-
case
:
"
自定义专题筛选器接口成功case"
unit_id
:
20236
assert
:
0
-
case
:
"
自定义专题筛选器接口数据返回正常case"
unit_id
:
20236
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