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
1c69f702
Commit
1c69f702
authored
Aug 12, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模拟feed流
parent
12e13ef6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
19 deletions
+84
-19
feed_request.py
all_backend_api/feed_request.py
+34
-19
feed_request.yaml
all_backend_api/feed_request.yaml
+11
-0
path_setting.py
path_setting.py
+2
-0
test_index_ai.py
test_backend_case/feed_case/test_index_ai.py
+30
-0
index_ai.yaml
test_backend_data/feed_data/index_ai.yaml
+7
-0
No files found.
all_backend_api/feed_request.py
View file @
1c69f702
...
@@ -70,24 +70,39 @@ class feed_request(BaseRequest):
...
@@ -70,24 +70,39 @@ class feed_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"winning_user_lis"
])
return
self
.
api_send
(
self
.
data
[
"winning_user_lis"
])
# 模拟双眼皮,发型,眉形,美瞳,口红下,新增feed流
def
index_ai
(
self
,
tag_names
,
scan_type
,
offset
,
current_city_id
):
self
.
params
[
"tag_names"
]
=
tag_names
self
.
params
[
"scan_type"
]
=
scan_type
self
.
params
[
"offset"
]
=
offset
self
.
params
[
"current_city_id"
]
=
current_city_id
if
__name__
==
'__main__'
:
return
self
.
api_send
(
self
.
data
[
"index_ai"
])
print
(
feed_request
()
.
index_v9
(
"choice"
,
"7.42.2"
,
"beijing"
))
#社区tab页签到和招募活动列表
print
(
feed_request
()
.
config_list
(
"7.44.0"
))
#免费招募列表背景图片
print
(
feed_request
()
.
free_recruit_banner
(
"7.44.1"
,
" "
))
# 免费招募列表
print
(
feed_request
()
.
free_recruit_list
(
"7.44.1"
,
" "
,
"1"
,
"1"
,
"10"
))
# 免费招募活动详情
print
(
feed_request
()
.
free_recruit_detail
(
"beijing"
,
"43"
))
# 免费招募获取用户状态
if
__name__
==
'__main__'
:
print
(
feed_request
()
.
user_status
(
"beijing"
,
"43"
))
# print(feed_request().index_v9("choice", "7.42.2", "beijing"))
#
# 免费招募查看中奖名单
# #社区tab页签到和招募活动列表
print
(
feed_request
()
.
winning_user_lis
(
"44"
,
" "
))
# print(feed_request().config_list("7.44.0"))
\ No newline at end of file
#
# #免费招募列表背景图片
# print(feed_request().free_recruit_banner("7.44.1", " "))
#
# # 免费招募列表
# print(feed_request().free_recruit_list("7.44.1", " ", "1", "1", "10"))
#
# # 免费招募活动详情
# print(feed_request().free_recruit_detail("beijing", "43"))
#
# # 免费招募获取用户状态
# print(feed_request().user_status("beijing", "43"))
#
# # 免费招募查看中奖名单
# print(feed_request().winning_user_lis("44", " "))
# print(feed_request().index_ai('["埋线双眼皮","定点双眼皮","切开双眼皮"]', 6, 2, "beijing"))
import
base64
st
=
'40dc0558ffc3f3f14503104d:e7f609c9c6a64e5cfaa3c9e0'
.
encode
()
# 默认以utf8编码
res
=
base64
.
b64encode
(
st
)
print
(
res
.
decode
())
\ No newline at end of file
all_backend_api/feed_request.yaml
View file @
1c69f702
...
@@ -89,3 +89,13 @@ winning_user_lis:
...
@@ -89,3 +89,13 @@ winning_user_lis:
data
:
data
:
json
:
{
}
json
:
{
}
isLogin
:
1
isLogin
:
1
# 模拟双眼皮,发型,眉形,美瞳,口红下,新增feed流
index_ai
:
method
:
get
url
:
/api/feed/index/ai
params
:
tag_names
:
${tag_names}
scan_type
:
${scan_type}
offset
:
${offset}
current_city_id
:
${current_city_id}
\ No newline at end of file
path_setting.py
View file @
1c69f702
...
@@ -235,6 +235,8 @@ GMAI_SIMULATE_CONF_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data
...
@@ -235,6 +235,8 @@ GMAI_SIMULATE_CONF_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data
# 模拟双眼皮,发型,美瞳,眉毛下日记推荐(根据标签)
# 模拟双眼皮,发型,美瞳,眉毛下日记推荐(根据标签)
EYELIDS_DIARY_CARDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"eyelids_request.yaml"
)
EYELIDS_DIARY_CARDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"eyelids_request.yaml"
)
EYELIDS_DIARY_CARDS_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/eyelids_data"
,
"diary_cards.yaml"
)
EYELIDS_DIARY_CARDS_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/eyelids_data"
,
"diary_cards.yaml"
)
# 模拟双眼皮,发型,美瞳,眉毛,口红下新版本feed推荐(根据标签)
FEED_INDEXAI_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/feed_data"
,
"index_ai.yaml"
)
# AI变脸结果
# AI变脸结果
GMAI_PLASTIC_ANALYSIS_V3_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"plastic_analysis_v3.yaml"
)
GMAI_PLASTIC_ANALYSIS_V3_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"plastic_analysis_v3.yaml"
)
...
...
test_backend_case/feed_case/test_index_ai.py
0 → 100644
View file @
1c69f702
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.feed_request
import
feed_request
class
TestIndexAi
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FEED_INDEXAI_DATA
)
indexai_case
,
indexai_data
=
get_ids
(
data
,
"index_ai"
)
@pytest.mark.skip
(
"跳过,目前测试环境数据较少"
)
@pytest.mark.parametrize
(
"param"
,
indexai_data
,
ids
=
indexai_case
)
def
test_index_ai
(
self
,
param
):
r
=
feed_request
()
.
index_ai
(
param
[
"tag_names"
],
param
[
"scan_type"
],
param
[
"offset"
],
param
[
"current_city_id"
])
if
r
[
"error"
]
==
0
:
offset
=
r
[
"data"
][
"offset"
]
assert
offset
==
14
features
=
r
[
"data"
][
"features"
]
assert
len
(
features
)
==
12
i
=
0
# 目前临时方案,一半商业流量,一半自然流量
for
index
in
features
:
print
(
index
[
"card_type"
])
if
i
%
2
==
0
:
assert
index
[
"card_type"
]
in
(
0
,
19
,
9
)
else
:
assert
index
[
"card_type"
]
==
43
i
+=
1
test_backend_data/feed_data/index_ai.yaml
0 → 100644
View file @
1c69f702
index_ai
:
-
case
:
"
模拟双眼皮,新版本feed流"
tag_names
:
'
["埋线双眼皮","定点双眼皮","切开双眼皮"]'
scan_type
:
6
offset
:
2
current_city_id
:
"
beijing"
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