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
92007f29
Commit
92007f29
authored
Jun 07, 2021
by
冯艮霞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
次卡商详和适用机构
parent
2d8c14f9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
152 additions
and
9 deletions
+152
-9
janus_request.py
all_backend_api/janus_request.py
+31
-9
janus_request.yaml
all_backend_api/janus_request.yaml
+31
-0
path_setting.py
path_setting.py
+8
-0
test_beauty_card_detail.py
test_backend_case/janus_case/test_beauty_card_detail.py
+18
-0
test_service_hospital.py
test_backend_case/janus_case/test_service_hospital.py
+18
-0
beauty_card_detail.yaml
test_backend_data/janus_data/beauty_card_detail.yaml
+28
-0
service_hospital.yaml
test_backend_data/janus_data/service_hospital.yaml
+18
-0
No files found.
all_backend_api/janus_request.py
View file @
92007f29
...
@@ -13,6 +13,9 @@ class janus_request(BaseRequest):
...
@@ -13,6 +13,9 @@ class janus_request(BaseRequest):
#品类聚合页面标签和专场
#品类聚合页面标签和专场
self
.
data
=
self
.
api_load
(
path_setting
.
POLYMER_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
POLYMER_CONFIG
)
#次卡商详页
self
.
data
=
self
.
api_load
(
path_setting
.
BEAUTY_CARD_DETAIL_CONFIG
)
#搜索结果页-综合/百科tab
#搜索结果页-综合/百科tab
def
content_v7
(
self
,
query
,
device_id
,
current_city_id
,
version
,
is_first
,
tab_type
,
offset
):
def
content_v7
(
self
,
query
,
device_id
,
current_city_id
,
version
,
is_first
,
tab_type
,
offset
):
#搜索词
#搜索词
...
@@ -82,7 +85,6 @@ class janus_request(BaseRequest):
...
@@ -82,7 +85,6 @@ class janus_request(BaseRequest):
# 品类聚合页面标签和专场
# 品类聚合页面标签和专场
def
polymer
(
self
,
version
,
category_polymer_id
,
device_id
):
def
polymer
(
self
,
version
,
category_polymer_id
,
device_id
):
print
(
"fgx"
)
self
.
params
[
'version'
]
=
version
self
.
params
[
'version'
]
=
version
self
.
params
[
'category_polymer_id'
]
=
category_polymer_id
self
.
params
[
'category_polymer_id'
]
=
category_polymer_id
self
.
params
[
'device_id'
]
=
device_id
self
.
params
[
'device_id'
]
=
device_id
...
@@ -90,6 +92,30 @@ class janus_request(BaseRequest):
...
@@ -90,6 +92,30 @@ class janus_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"polymer"
])
return
self
.
api_send
(
self
.
data
[
"polymer"
])
# 次卡商详页
def
beauty_card_detail
(
self
,
spu_id
,
sku_id
,
welfareId
,
version
,
current_city_id
,
lat
,
lng
):
self
.
params
[
'spu_id'
]
=
spu_id
self
.
params
[
'sku_id'
]
=
sku_id
self
.
params
[
'welfareId'
]
=
welfareId
self
.
params
[
'version'
]
=
version
self
.
params
[
'current_city_id'
]
=
current_city_id
self
.
params
[
'lat'
]
=
lat
self
.
params
[
'lng'
]
=
lng
return
self
.
api_send
(
self
.
data
[
"beauty_card_detail"
])
# 次卡商详-适应机构列表
def
service_hospital
(
self
,
offset
,
sku_id
,
size
,
version
,
current_city_id
,
lat
,
lng
):
self
.
params
[
'offset'
]
=
offset
self
.
params
[
'sku_id'
]
=
sku_id
self
.
params
[
'size'
]
=
size
self
.
params
[
'version'
]
=
version
self
.
params
[
'current_city_id'
]
=
current_city_id
self
.
params
[
'lat'
]
=
lat
self
.
params
[
'lng'
]
=
lng
return
self
.
api_send
(
self
.
data
[
"service_hospital"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
#打印购物车-猜你喜欢列表接口返回
#打印购物车-猜你喜欢列表接口返回
print
(
janus_request
()
.
mine_guess_you_like
())
print
(
janus_request
()
.
mine_guess_you_like
())
...
@@ -98,12 +124,8 @@ if __name__ == '__main__':
...
@@ -98,12 +124,8 @@ if __name__ == '__main__':
#打印商祥页-sku信息接口返回
#打印商祥页-sku信息接口返回
print
(
janus_request
()
.
sku_info
(
"5857263"
,
"618788"
))
print
(
janus_request
()
.
sku_info
(
"5857263"
,
"618788"
))
#品类聚合页面商品列表接口返回
# 次卡商详页-适应机构
print
(
janus_request
()
.
tag_service
())
print
(
janus_request
()
.
beauty_card_detail
(
"100018"
,
"10046"
,
"100018"
,
"7.44.0"
,
"beijing"
,
"40.001879"
,
"116.487194"
))
print
(
"fgx"
)
# 次卡商详页
print
(
janus_request
()
.
service_hospital
(
"0"
,
"10046"
,
"1"
,
"7.44.0"
,
"beijing"
,
"40.001879"
,
"116.487194"
))
#品类聚合页面标签和专场
print
(
janus_request
()
.
polymer
())
print
(
"fgx"
)
all_backend_api/janus_request.yaml
View file @
92007f29
...
@@ -85,6 +85,37 @@ polymer:
...
@@ -85,6 +85,37 @@ polymer:
json
:
{
}
json
:
{
}
#次卡商详页
beauty_card_detail
:
method
:
GET
url
:
/api/janus/beauty_card/detail
params
:
spu_id
:
${spu_id}
sku_id
:
${sku_id}
welfareId
:
${welfareId}
version
:
${version}
current_city_id
:
${current_city_id}
lat
:
${lat}
lng
:
${lng}
data
:
{
}
json
:
{
}
#次卡商详页-适应机构列表
service_hospital
:
method
:
GET
url
:
/api/janus/beauty_card/service_hospital
params
:
offset
:
${offset}
sku_id
:
${sku_id}
size
:
${size}
version
:
${version}
current_city_id
:
${current_city_id}
lat
:
${lat}
lng
:
${lng}
data
:
{
}
json
:
{
}
...
...
path_setting.py
View file @
92007f29
...
@@ -220,5 +220,13 @@ HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data",
...
@@ -220,5 +220,13 @@ HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data",
FILTER_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"filter_request.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"
)
FILTER
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/filter_data"
,
"service_home_city_v2.yaml"
)
#次卡商详页
BEAUTY_CARD_DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_request.yaml"
)
BEAUTY_CARD_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"beauty_card_detail.yaml"
)
#次卡商详页-适应机构列表
SERVICE_HOSPITAL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_request.yaml"
)
SERVICE_HOSPITAL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"service_hospital.yaml"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_backend_case/janus_case/test_beauty_card_detail.py
0 → 100644
View file @
92007f29
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.janus_request
import
janus_request
class
TestBeautyCardDetail
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
BEAUTY_CARD_DETAIL
)
beauty_card_detail_case
,
beauty_card_detail_data
=
get_ids
(
data
,
"beauty_card_detail"
)
@pytest.mark.parametrize
(
"param"
,
beauty_card_detail_data
,
ids
=
beauty_card_detail_case
)
def
test_beauty_card_detail
(
self
,
param
):
r
=
janus_request
()
.
beauty_card_detail
(
param
[
"spu_id"
],
param
[
"sku_id"
],
param
[
"welfareId"
],
param
[
"version"
],
param
[
"current_city_id"
],
param
[
"lat"
],
param
[
"lng"
])
if
r
[
"error"
]
==
0
:
assert
len
(
r
[
"data"
][
"beautycart_list"
])
>
param
[
"assert"
]
test_backend_case/janus_case/test_service_hospital.py
0 → 100644
View file @
92007f29
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.janus_request
import
janus_request
class
TestServiceHospital
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SERVICE_HOSPITAL
)
service_hospital_case
,
service_hospital_data
=
get_ids
(
data
,
"service_hospital"
)
@pytest.mark.parametrize
(
"param"
,
service_hospital_data
,
ids
=
service_hospital_case
)
def
test_service_hospital
(
self
,
param
):
r
=
janus_request
()
.
service_hospital
(
param
[
"offset"
],
param
[
"sku_id"
],
param
[
"size"
],
param
[
"version"
],
param
[
"current_city_id"
],
param
[
"lat"
],
param
[
"lng"
])
if
r
[
"error"
]
==
0
:
assert
len
(
r
[
"data"
][
"service_hospital_list"
])
>
param
[
"assert"
]
test_backend_data/janus_data/beauty_card_detail.yaml
0 → 100644
View file @
92007f29
beauty_card_detail
:
#次卡商详页
-
case
:
"
次卡商详页spuid=100018"
assert
:
0
spu_id
:
100018
sku_id
:
10046
welfareId
:
100018
version
:
7.44.0
current_city_id
:
beijing
lat
:
40.001879
lng
:
116.487194
-
case
:
"
次卡商详页spuid=100021"
assert
:
0
spu_id
:
100021
sku_id
:
10159
welfareId
:
100021
version
:
7.44.0
current_city_id
:
beijing
lat
:
40.001879
lng
:
116.487194
test_backend_data/janus_data/service_hospital.yaml
0 → 100644
View file @
92007f29
service_hospital
:
#次卡商详页-适用机构列表
-
case
:
"
次卡适用机构列表spuid=100018"
assert
:
0
offset
:
0
sku_id
:
10046
size
:
1
version
:
7.44.0
current_city_id
:
beijing
lat
:
40.001879
lng
:
116.487194
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