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
3ef455ce
Commit
3ef455ce
authored
Aug 19, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目榜单
parent
4cdba2db
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
150 additions
and
11 deletions
+150
-11
janus_request.py
all_backend_api/janus_request.py
+32
-9
janus_request.yaml
all_backend_api/janus_request.yaml
+27
-2
path_setting.py
path_setting.py
+12
-0
commodity_rank.py
test_backend_case/janus_case/commodity_rank.py
+24
-0
test_project_rank.py
test_backend_case/janus_case/test_project_rank.py
+24
-0
commodity_rank.yaml
test_backend_data/janus_data/commodity_rank.yaml
+21
-0
project_rank.yaml
test_backend_data/janus_data/project_rank.yaml
+10
-0
No files found.
all_backend_api/janus_request.py
View file @
3ef455ce
...
@@ -4,6 +4,8 @@ from in_common.base_request import BaseRequest
...
@@ -4,6 +4,8 @@ from in_common.base_request import BaseRequest
class
janus_request
(
BaseRequest
):
class
janus_request
(
BaseRequest
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
JANUS_CONFIG
)
#捜索结果页-综合/百科tab
#捜索结果页-综合/百科tab
self
.
data
=
self
.
api_load
(
path_setting
.
CONTENTV7_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
CONTENTV7_CONFIG
)
...
@@ -25,6 +27,9 @@ class janus_request(BaseRequest):
...
@@ -25,6 +27,9 @@ class janus_request(BaseRequest):
#直播获取美颜
#直播获取美颜
#self.data = self.api_load(path_setting.BEAUTY_CONFIG)
#self.data = self.api_load(path_setting.BEAUTY_CONFIG)
# #项目榜单主页
# self.data = self.api_load(path_setting.PROJECT_RANK_CONFIG)
...
@@ -261,6 +266,21 @@ class janus_request(BaseRequest):
...
@@ -261,6 +266,21 @@ class janus_request(BaseRequest):
#
#
#项目榜单主页
def
project_rank
(
self
,
id
,
version
,
current_city_id
,
device_id
=
'8C3EB981-B22D-43E2-B208-34F6036505BB'
):
self
.
params
[
"id"
]
=
id
self
.
params
[
"version"
]
=
version
self
.
params
[
"current_city_id"
]
=
current_city_id
return
self
.
api_send
(
self
.
data
[
"project_rank"
])
#项目榜单-商品榜单排序
def
commodity_rank
(
self
,
sort_type
,
commodity_rank_id
,
version
,
device_id
=
'8C3EB981-B22D-43E2-B208-34F6036505BB'
):
self
.
params
[
"sort_type"
]
=
sort_type
self
.
params
[
"commodity_rank_id"
]
=
commodity_rank_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"commodity_rank"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
@@ -366,13 +386,16 @@ if __name__ == '__main__':
...
@@ -366,13 +386,16 @@ if __name__ == '__main__':
# #直播-点击【设置封面】
# #直播-点击【设置封面】
# print("直播-点击【设置封面】")
# print("直播-点击【设置封面】")
# print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
# print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
#直播-点击【设置封面】
# #直播-点击【设置封面】
print
(
"直播-点击【设置封面】"
)
# print("直播-点击【设置封面】")
print
(
janus_request
()
.
page_rules
(
"744.2"
,
"beijing"
,
"post_add_pic"
))
# print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
#直播-主播获取美颜
# #直播-主播获取美颜
print
(
"meiyan"
)
# print("meiyan")
print
(
janus_request
()
.
beauty
(
"739"
))
# print(janus_request().beauty("739"))
#直播-主播修改美颜
# #直播-主播修改美颜
print
(
"change meiyan"
)
# print("change meiyan")
print
(
janus_request
()
.
beauty_post
(
"739"
,
"true"
,
"0.60"
,
"0.40"
,
"0.70"
))
# print(janus_request().beauty_post("739","true","0.60","0.40","0.70"))
#项目榜单主页
print
(
janus_request
()
.
project_rank
(
"143"
,
"748.0"
,
"beijing"
))
all_backend_api/janus_request.yaml
View file @
3ef455ce
#搜索结果页
content_v7
:
content_v7
:
method
:
get
method
:
get
url
:
/api/janus/search/v7/content
url
:
/api/janus/search/v7/content
...
@@ -13,6 +14,7 @@ content_v7:
...
@@ -13,6 +14,7 @@ content_v7:
data
:
{}
data
:
{}
json
:
{}
json
:
{}
#医院主页搜索
hospital_search
:
hospital_search
:
method
:
get
method
:
get
url
:
/api/janus/search/hospital_search
url
:
/api/janus/search/hospital_search
...
@@ -355,4 +357,27 @@ sales_lead_spu_by_diary:
...
@@ -355,4 +357,27 @@ sales_lead_spu_by_diary:
lng
:
${lng}
lng
:
${lng}
data
:
{}
data
:
{}
json
:
{}
json
:
{}
isLogin
:
0
isLogin
:
0
\ No newline at end of file
#项目榜单主页
project_rank
:
method
:
GET
url
:
/api/janus/product/mall/project_rank
params
:
id
:
${id}
version
:
${version}
current_city_id
:
${current_city_id}
data
:
{}
json
:
{}
#项目榜单-商品榜单排序
commodity_rank
:
method
:
GET
url
:
/api/janus/product/mall/commodity_rank
params
:
sort_type
:
${sort_type}
commodity_rank_id
:
${commodity_rank_id}
version
:
${version}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
3ef455ce
...
@@ -9,6 +9,7 @@ LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_func
...
@@ -9,6 +9,7 @@ LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_func
APYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
APYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
JANUS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_request.yaml"
)
# 日记本总接口配置
# 日记本总接口配置
DIARY_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_request.yaml"
)
DIARY_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_request.yaml"
)
...
@@ -769,5 +770,15 @@ FAVORS_ANASWERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_da
...
@@ -769,5 +770,15 @@ FAVORS_ANASWERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_da
ACCOUNT_HOMEPAGE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
ACCOUNT_HOMEPAGE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
ACCOUNT_HOMEPAGE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"account_homepage.yaml"
)
ACCOUNT_HOMEPAGE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"account_homepage.yaml"
)
#项目榜单主页
# PROJECT_RANK_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
PROJECT_RANK
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"project_rank.yaml"
)
#项目榜单-商品榜单排序
COMMODITY_RANK
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"commodity_rank.yaml"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
print
(
"=========="
,
LIVEYAML_CONFIG
)
\ No newline at end of file
test_backend_case/janus_case/commodity_rank.py
0 → 100644
View file @
3ef455ce
import
pytest
import
path_setting
from
all_backend_api.janus_request
import
janus_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestCommodityRank
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
COMMODITY_RANK
)
commodity_rank_case
,
commodity_rank_data
=
get_ids
(
data
,
"commodity_rank"
)
@pytest.mark.parametrize
(
"param"
,
commodity_rank_data
,
ids
=
commodity_rank_case
)
def
test_commodity_rank
(
self
,
param
):
project_rank
=
janus_request
()
.
project_rank
(
"143"
,
"748.0"
,
"beijing"
)
param
[
"title"
]
=
project_rank
[
"data"
][
"project_detail"
][
"items"
][
0
][
"title"
]
param
[
"commodity_rank_id"
]
=
project_rank
[
"data"
][
"project_detail"
][
"items"
][
0
][
"exposure"
][
"card_id"
]
r
=
janus_request
()
.
commodity_rank
(
param
[
"sort_type"
],
param
[
"commodity_rank_id"
],
param
[
"version"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"commodity_detail"
][
"title"
]
==
param
[
"title"
]
print
(
"项目榜单-商品榜单接口已通"
)
else
:
assert
r
[
"error"
]
==
param
[
"assert_error"
]
print
(
"项目榜单-商品榜单接口出错了"
)
test_backend_case/janus_case/test_project_rank.py
0 → 100644
View file @
3ef455ce
import
pytest
import
path_setting
from
all_backend_api.janus_request
import
janus_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestProjectRank
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
PROJECT_RANK
)
project_rank_case
,
project_rank_data
=
get_ids
(
data
,
"project_rank"
)
@pytest.mark.parametrize
(
"param"
,
project_rank_data
,
ids
=
project_rank_case
)
def
test_project_rank
(
self
,
param
):
r
=
janus_request
()
.
project_rank
(
param
[
"id"
],
param
[
"version"
],
param
[
"current_city_id"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"project_detail"
][
"title"
]
==
param
[
"assert"
]
print
(
"项目榜单主页接口已通"
)
else
:
assert
r
[
"error"
]
==
param
[
"assert_error"
]
print
(
"接口出错了"
)
test_backend_data/janus_data/commodity_rank.yaml
0 → 100644
View file @
3ef455ce
commodity_rank
:
#项目榜单-商品榜单,按销量榜排序
-
case
:
"
项目榜单-商品榜单,按照销量榜排序"
sort_type
:
30
commodity_rank_id
:
#此字段取自项目榜单主页接口
version
:
748.0
-
case
:
"
项目榜单-商品榜单,按人气榜排序"
sort_type
:
31
commodity_rank_id
:
version
:
748.0
-
case
:
"
项目榜单-商品榜单,按口碑榜排序"
sort_type
:
32
commodity_rank_id
:
version
:
748.0
test_backend_data/janus_data/project_rank.yaml
0 → 100644
View file @
3ef455ce
project_rank
:
#项目榜单主页
-
case
:
"
项目榜单主页接口已通"
id
:
143
version
:
748
current_city_id
:
beijing
assert
:
测试商品榜单
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