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
b944b4a6
Commit
b944b4a6
authored
Jun 09, 2021
by
张慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商祥页-推荐商品列表接口
parent
2017c44e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
0 deletions
+60
-0
hybrid_promotion_request.py
all_backend_api/hybrid_promotion_request.py
+21
-0
hybrid_promotion_request.yaml
all_backend_api/hybrid_promotion_request.yaml
+10
-0
path_setting.py
path_setting.py
+3
-0
__init__.py
test_backend_case/hybrid_promotion_case/__init__.py
+0
-0
test_related_service_data.py
...d_case/hybrid_promotion_case/test_related_service_data.py
+19
-0
__init__.py
test_backend_data/hybrid_promotion_data/__init__.py
+0
-0
related_service_data.yaml
...kend_data/hybrid_promotion_data/related_service_data.yaml
+7
-0
No files found.
all_backend_api/hybrid_promotion_request.py
0 → 100644
View file @
b944b4a6
import
path_setting
from
in_common.base_request
import
BaseRequest
class
hybrid_promotion_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
HYBRID_PROMOTION_CONFIG
)
#商祥页-sku信息
def
related_service_data
(
self
,
service_id
,
page
):
self
.
params
[
"service_id"
]
=
service_id
self
.
params
[
"page"
]
=
page
return
self
.
api_send
(
self
.
data
[
"related_service_data"
])
if
__name__
==
'__main__'
:
#打印商祥页-推荐商品列表接口返回
print
(
hybrid_promotion_request
()
.
related_service_data
(
"5815040"
,
1
))
all_backend_api/hybrid_promotion_request.yaml
0 → 100644
View file @
b944b4a6
#商祥页-推荐商品列表
related_service_data
:
method
:
get
url
:
/hybrid/promotion/related_service/_data
params
:
service_id
:
${service_id}
page
:
${page}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
b944b4a6
...
...
@@ -198,6 +198,9 @@ HYBRID_GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api",
GET_GIFT_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_get_gift_data"
,
"get_gift_data.yaml"
)
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
PRODUCT_COUPON_MY_LIST
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"product_coupon_my_list.yaml"
)
#商祥页-推荐商品列表
HYBRID_PROMOTION_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hybrid_promotion_request.yaml"
)
RELATED_SERVICE_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_promotion_data"
,
"related_service_data.yaml"
)
#捜索结果页-医生/医院tab
CONTENTV6_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
...
...
test_backend_case/hybrid_promotion_case/__init__.py
0 → 100644
View file @
b944b4a6
test_backend_case/hybrid_promotion_case/test_related_service_data.py
0 → 100644
View file @
b944b4a6
import
pytest
from
all_backend_api.hybrid_promotion_request
import
hybrid_promotion_request
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
class
TestTelatedServiceData
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
RELATED_SERVICE_DATA
)
related_service_data_case
,
related_service_data_data
=
get_ids
(
data
,
"related_service_data"
)
@pytest.mark.parametrize
(
"param"
,
related_service_data_data
,
ids
=
related_service_data_case
)
def
test_related_service_data
(
self
,
param
):
r
=
hybrid_promotion_request
()
.
related_service_data
(
param
[
"service_id"
],
param
[
"page"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert_error"
]
test_backend_data/hybrid_promotion_data/__init__.py
0 → 100644
View file @
b944b4a6
test_backend_data/hybrid_promotion_data/related_service_data.yaml
0 → 100644
View file @
b944b4a6
related_service_data
:
-
case
:
"
商祥页-推荐商品列表-接口调用成功case"
service_id
:
"
5815040"
page
:
1
assert_error
:
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