Commit 1c69f702 authored by 张伟男's avatar 张伟男

模拟feed流

parent 12e13ef6
......@@ -70,24 +70,39 @@ class feed_request(BaseRequest):
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__':
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"))
return self.api_send(self.data["index_ai"])
# 免费招募活动详情
print(feed_request().free_recruit_detail("beijing", "43"))
# 免费招募获取用户状态
print(feed_request().user_status("beijing", "43"))
# 免费招募查看中奖名单
print(feed_request().winning_user_lis("44", " "))
\ No newline at end of file
if __name__ == '__main__':
# 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"))
#
# # 免费招募获取用户状态
# 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
......@@ -89,3 +89,13 @@ winning_user_lis:
data:
json: { }
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
......@@ -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_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变脸结果
GMAI_PLASTIC_ANALYSIS_V3_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v3.yaml")
......
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
index_ai:
-
case: "模拟双眼皮,新版本feed流"
tag_names: '["埋线双眼皮","定点双眼皮","切开双眼皮"]'
scan_type: 6
offset: 2
current_city_id: "beijing"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment