Commit 359bc78c authored by edz's avatar edz

live-push_live_info

parent 728f47ab
......@@ -5,7 +5,6 @@ from in_common.base_request import BaseRequest
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
......@@ -24,5 +23,5 @@ class living_request(BaseRequest):
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
(living_request().danmu_v2("739", "1"))
(living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
\ No newline at end of file
......@@ -22,4 +22,5 @@ pushlive_info:
device_type: ${device_type}
data: {}
json: {}
isLogin: 1
......@@ -80,13 +80,18 @@ class BaseRequest:
s = LoginFunction().get_session()
# 调用具体case的url
print(req['method'])
print(url_host + req['url'])
print(req.get('params'))
print(req.get('data'))
r = s.request(
req['method'],
url=url_host + req['url'],
params=req.get('params'),
# headers=user_headers,
data=req.get('data'),
json=req.get('json')
json=req.get('json'),
# proxies={"http":"172.30.9.226:8888"}
)
return r.json()
......
......@@ -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
else:
assert r["message"] == param["assert_message"]
\ No newline at end of file
......@@ -11,7 +11,10 @@ class TestPushLiveInfo:
@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"])
print('--------',r)
if r["error"] == 0:
assert r["error"] == param["assert"]
else:
assert r["message"] == param['assert_message0']
\ No newline at end of file
......@@ -6,6 +6,7 @@ danmu_v2:
msg_id: 1
user_id: ""
assert: 0
assert_message: "获取弹幕失败"
#获取弹幕失败case
# -
......
......@@ -5,34 +5,42 @@ push_live_info:
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: ""
tag_id: "快乐就是我的标签"
tag_id: "1"
clarity: "1"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
-
case: "主播开播成功-填写标签"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "快乐就是我的标签"
tag_id: "1"
clarity: "1"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
-
case: "主播开播成功-清晰度:高清开播"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "快乐就是我的标签"
tag_id: "1"
clarity: "2"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
-
case: "主播开播成功-清晰度:超高清开播"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "快乐就是我的标签"
tag_id: "1"
clarity: "2"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
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