Commit 728f47ab authored by edz's avatar edz

22号

parent e8ca6669
......@@ -6,11 +6,23 @@ class living_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.LIVEYAML_CONFIG)
print('=====',self.data)
#获取弹幕
def danmu_v2(self,channel_id,msg_id,user_id=""):
self.params["channel_id"] = channel_id
self.params["msg_id"] = msg_id
self.params["user_id"] = user_id
return self.api_send(self.data["danmu_v2"])
#主播开播
def pushlive_info(self,title,cover_url,notice,tag_id,clarity,device_type):
self.params["title"] = title
self.params["cover_url"] = cover_url
self.params["notice"] = notice
self.params["tag_id"] = tag_id
self.params["clarity"] = clarity
self.params["device_type"] = device_type
return self.api_send(self.data["pushlive_info"])
if __name__ == '__main__':
(living_request().danmu_v2("739","1",""))
\ No newline at end of file
(living_request().danmu_v2("739","1"))
(living_request().pushlive_info("小冤家","2021/04/22/1003/cef471cff5e6","","1","1","1"))
\ No newline at end of file
#获取弹幕
danmu_v2:
method: get
url: /api/live/danmu_v2
......@@ -6,4 +7,19 @@ danmu_v2:
msg_id: ${msg_id}
user_id: ${user_id}
data: {}
json: {}
\ No newline at end of file
json: {}
#主播开播
pushlive_info:
method: get
url: /api/live/push_live_info
params:
title: ${title}
cover_url: ${cover_url}
notice: ${notice}
tag_id: ${tag_id}
clarity: ${clarity}
device_type: ${device_type}
data: {}
json: {}
......@@ -67,6 +67,8 @@ HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","hom
LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
#直播-获取弹幕
DANMU_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "danmu_v2.yaml")
#直播-主播开播
PUSH_LIVE_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "pushlive_info.yaml")
......
......@@ -15,5 +15,5 @@ class TestDanmuV2:
r = living_request().danmu_v2(param["channel_id"],param["msg_id"],param["user_id"])
if r["error"] == 0:
assert r["error"] == param["assert"]
if r["error"] == 1:
assert r["error"] == param["assert"]
\ No newline at end of file
# if r["error"] == 1:
# assert r["error"] == param["assert"]
\ No newline at end of file
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.live_request import living_request
class TestPushLiveInfo:
data = BaseRequest().api_load(path_setting.PUSH_LIVE_INFO)
pushliveinfo_case, pushliveinfo_data = get_ids(data,"push_live_info")
@pytest.mark.parametrize("param", pushliveinfo_data, ids=pushliveinfo_case)
def test_pushlive_info(self, param):
print(param)
r = living_request().pushlive_info(param["title"],param["cover_url"],param["notice"],param["tag_id"],param["clarity"],param["device_type"])
if r["error"] == 0:
assert r["error"] == param["assert"]
......@@ -8,9 +8,9 @@ danmu_v2:
assert: 0
#获取弹幕失败case
-
case: "获取弹幕失败-进入房间失败"
channel_id: ""
msg_id: 1
user_id: ""
assert: 0
\ No newline at end of file
# -
# case: "获取弹幕失败-获取房间信息失败"
# channel_id: ""
# msg_id: 1
# user_id: ""
# assert: 0
\ No newline at end of file
push_live_info:
#主播成功开播case
-
case: "主播开播成功-未填写标签"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: ""
tag_id: "快乐就是我的标签"
clarity: "1"
device_type: "1"
assert: 0
-
case: "主播开播成功-填写标签"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "快乐就是我的标签"
clarity: "1"
device_type: "1"
assert: 0
-
case: "主播开播成功-清晰度:高清开播"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "快乐就是我的标签"
clarity: "2"
device_type: "1"
assert: 0
-
case: "主播开播成功-清晰度:超高清开播"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "快乐就是我的标签"
clarity: "2"
device_type: "1"
assert: 0
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