Commit 94aadca8 authored by aha's avatar aha

zhubo finish

parent 6292c508
...@@ -34,8 +34,15 @@ class living_request(BaseRequest): ...@@ -34,8 +34,15 @@ class living_request(BaseRequest):
self.params["version"] = version self.params["version"] = version
return self.api_send(self.data["leave"]) return self.api_send(self.data["leave"])
#直播结束-主播下播
def finish(self,channel_id, version, device_id="97B6764B-2135-4761-9911-701C38CBC272"):
self.params["channel_id"] = channel_id
self.params["version"] = version
return self.api_send(self.data["finish"])
if __name__ == '__main__': if __name__ == '__main__':
(living_request().danmu_v2("739", "1")) (living_request().danmu_v2("739", "1"))
(living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1")) (living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
print(living_request().finish("745", "746.0"))
\ No newline at end of file
...@@ -26,7 +26,7 @@ pushlive_info: ...@@ -26,7 +26,7 @@ pushlive_info:
#观众进入直播间 #观众进入直播间
enter: enter:
method: get method: GET
url: /api/live/enter url: /api/live/enter
params: params:
channel_id: ${channel_id} channel_id: ${channel_id}
...@@ -38,7 +38,7 @@ enter: ...@@ -38,7 +38,7 @@ enter:
#观众离开直播间 #观众离开直播间
leave: leave:
method: get method: GET
url: /api/live/leave url: /api/live/leave
params: params:
channel_id: ${channel_id} channel_id: ${channel_id}
...@@ -47,4 +47,15 @@ leave: ...@@ -47,4 +47,15 @@ leave:
json: {} json: {}
isLogin: 1 isLogin: 1
#直播结束-主播下播
finish:
method: POST
url: /api/live/finish
params:
version: ${version}
data:
channel_id: ${channel_id}
json: {}
isLogin: 1
...@@ -587,6 +587,10 @@ ENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "ente ...@@ -587,6 +587,10 @@ ENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "ente
LEAVE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml") LEAVE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
LEAVE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "leave.yaml") LEAVE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "leave.yaml")
#直播结束-主播下播
FINISH_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
FINISH = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "finish.yaml")
#主播标记讲解商品+取消标记 #主播标记讲解商品+取消标记
MARK_LIVE_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml") MARK_LIVE_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
MARK_LIVE_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "mark_live_service.yaml") MARK_LIVE_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "mark_live_service.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
class TestFinish:
data = BaseRequest().api_load(path_setting.FINISH)
finish_case, finish_data = get_ids(data,"finish")
@pytest.mark.parametrize("param", finish_data, ids=finish_case)
def test_finish(self, param):
r = living_request().finish(param["channel_id"], param["version"])
print("主播下播了,呜呜呜")
if r["error"] == 0:
assert r["error"] == param["assert"]
\ No newline at end of file
finish:
#主播下播了,呜呜呜
-
case: "主播下播了,呜呜呜"
channel_id: "745"
version: "7.45.0"
assert: 0
\ No newline at end of file
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