Commit 33a4b9bf authored by edz's avatar edz

发送弹幕

parent 49fa5260
......@@ -11,7 +11,7 @@ class living_request(BaseRequest):
self.params["msg_id"] = msg_id
self.params["user_id"] = user_id
return self.api_send(self.data["danmu_v2"])
#主播开播
#主播开播git
def pushlive_info(self,title,cover_url,notice,tag_id,clarity,device_type):
self.params["title"] = title
self.params["cover_url"] = cover_url
......@@ -20,9 +20,13 @@ class living_request(BaseRequest):
self.params["clarity"] = clarity
self.params["device_type"] = device_type
return self.api_send(self.data["pushlive_info"])
#用户-发送弹幕
def sendmsg(self,channel_id,msg):
self.params["channel_id"] = channel_id
self.params["msg"] = msg
return self.api_send(self.data['sendmsg'])
if __name__ == '__main__':
(living_request().danmu_v2("739", "1"))
(living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
\ No newline at end of file
# print (living_request().danmu_v2("739", "1"))
# print (living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
print (living_request().sendmsg("739","你好"))
\ No newline at end of file
......@@ -52,4 +52,13 @@ search_services:
json: {}
isLogin: 1
#用户-发送弹幕
sendmsg:
method: POST
url: /api/live/sendmsg
params: {}
data:
channel_id: ${channel_id}
msg: ${msg}
json: {}
isLogin: 1
......@@ -308,7 +308,8 @@ LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_r
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")
#直播-发送弹幕
SENDMSG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "sendmsg.yaml")
#商祥页-详情
......
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
#@pytest.fixture(scope='function')
#def create_live():
# pass
class TestSendmsg:
data = BaseRequest().api_load(path_setting.SENDMSG)
sendmsg_case, sendmsg_data = get_ids(data, "sendmsg")
@pytest.mark.parametrize("param",sendmsg_data,ids=sendmsg_case)
def test_sendmsg(self,param):
r = living_request().sendmsg(param["channel_id"],param["msg"])
if r["error"] == 0:
assert r["error"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
\ No newline at end of file
sendmsg:
#发送弹幕
-
case: "发送弹幕"
channel_id: "726"
msg: "主播可真美"
assert: 0
#弹幕内容包含敏感信息,发送失败
-
case: "弹幕内容包含敏感信息,发送失败"
channel_id: "784"
msg: "黄色图片"
assert: 您输入的内容包含敏感信息,请重新输入
\ No newline at end of file
......@@ -3,7 +3,7 @@ reply_create:
beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-07-14 18:15:39
content: ces测试+2021-07-16 10:25:27
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
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