Commit 21650e8c authored by edz's avatar edz

观众分享直播

parent e186e06d
...@@ -135,6 +135,12 @@ class live_request(BaseRequest): ...@@ -135,6 +135,12 @@ class live_request(BaseRequest):
def service_page_live_enter(self,service_id): def service_page_live_enter(self,service_id):
self.params["service_id"] = service_id self.params["service_id"] = service_id
return self.api_send(self.data["service_page_live_enter"]) return self.api_send(self.data["service_page_live_enter"])
#观众分享直播
def share_click(self,stream_id,share_channel):
self.params["stream_id"] = stream_id
self.params["share_channle"] = share_channel
return self.api_send(self.data["share_click"])
if __name__ == '__main__': if __name__ == '__main__':
# print(live_request().live_services("745", "4177", "0", "10")) # print(live_request().live_services("745", "4177", "0", "10"))
...@@ -148,4 +154,5 @@ if __name__ == '__main__': ...@@ -148,4 +154,5 @@ if __name__ == '__main__':
print(live_request().add_live_gift("739", "59127", "", "4283", "7.45.0")) print(live_request().add_live_gift("739", "59127", "", "4283", "7.45.0"))
print(live_request().delete_live_gift("739", "59127", "1", "4283", "7.45.0")) print(live_request().delete_live_gift("739", "59127", "1", "4283", "7.45.0"))
# print(live_request().pop_gift("4271", "59124", "746.0")) # print(live_request().pop_gift("4271", "59124", "746.0"))
# print(live_request().get_gift( "59124", "746.0")) # print(live_request().get_gift( "59124", "746.0"))
\ No newline at end of file print(live_request().share_click('4340','What'))
\ No newline at end of file
...@@ -172,4 +172,14 @@ service_page_live_enter: ...@@ -172,4 +172,14 @@ service_page_live_enter:
params: params:
service_id: ${service_id} service_id: ${service_id}
data: {} data: {}
json: {}
#观众点击直播内美购
share_click:
method: post
url: /api/janus/live/share_click
params: {}
data:
stream_id: ${stream_id}
share_channel: ${share_channel}
json: {} json: {}
\ No newline at end of file
...@@ -724,6 +724,9 @@ DELETEGIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_d ...@@ -724,6 +724,9 @@ DELETEGIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_d
M_GET_CHANNEL_STATUS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml") M_GET_CHANNEL_STATUS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
M_GET_CHANNEL_STATUS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "m_get_channel_status.yaml") M_GET_CHANNEL_STATUS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "m_get_channel_status.yaml")
#观众分享直播
SHARE_CLICK = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "share_click.yaml")
#观众进入直播间 #观众进入直播间
ENTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml") ENTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
ENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "enter.yaml") ENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "enter.yaml")
......
import pytest
import path_setting
from all_backend_api.janus_live_request import live_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestShareClick:
data = BaseRequest().api_load(path_setting.SHARE_CLICK)
share_click_case, share_click_data = get_ids(data, "share_click")
@pytest.mark.parametrize("param", share_click_data, ids=share_click_case)
def test_share_click(self, param):
r = live_request().share_click(param["stream_id"], param["share_channel"],)
if r["error"] == 0:
assert r["error"] == param["assert"]
else:
assert r["error"] == param["assert"]
\ No newline at end of file
share_click:
-
case: "观众分享直播-微信"
url: /api/janus/live/share_click
stream_id: "4340"
share_channel: "Wchat"
assert: 0
-
case: "观众分享直播-朋友圈"
url: /api/janus/live/share_click
stream_id: "4340"
share_channel: "WechatMoments"
assert: 0
-
case: "观众分享直播-qq"
url: /api/janus/live/share_click
stream_id: "4340"
share_channel: "QQ"
assert: 0
-
case: "观众分享直播-微博"
url: /api/janus/live/share_click
stream_id: "4340"
share_channel: "Weibo"
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