Commit e1ce206b authored by aha's avatar aha

直播

parent 248da587
...@@ -10,6 +10,7 @@ class live_request(BaseRequest): ...@@ -10,6 +10,7 @@ class live_request(BaseRequest):
self.data = self.api_load(path_setting.ADDLIVESERVICE_CONFIG) self.data = self.api_load(path_setting.ADDLIVESERVICE_CONFIG)
self.data = self.api_load(path_setting.DELETELIVESERVICE_CONFIG) self.data = self.api_load(path_setting.DELETELIVESERVICE_CONFIG)
self.data = self.api_load(path_setting.DELETEGIFT_CONFIG) self.data = self.api_load(path_setting.DELETEGIFT_CONFIG)
self.data = self.api_load(path_setting.M_GET_CHANNEL_STATUS_CONFIG)
#主播-推荐袋美购列表展示 #主播-推荐袋美购列表展示
def live_services(self, channel_id, stream_id, offset, size): def live_services(self, channel_id, stream_id, offset, size):
...@@ -73,8 +74,15 @@ class live_request(BaseRequest): ...@@ -73,8 +74,15 @@ class live_request(BaseRequest):
self.params["version"] = version self.params["version"] = version
return self.api_send(self.data["delete_live_gift"]) return self.api_send(self.data["delete_live_gift"])
#获取直播间状态
def m_get_channel_status(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["m_get_channel_status"])
if __name__ == '__main__': if __name__ == '__main__':
print(live_request().live_services("745", "4177", "0", "10")) # print(live_request().live_services("745", "4177", "0", "10"))
print(live_request().search_service("beijing", "745", "", "0", "20", "7.45.0")) # print(live_request().search_service("beijing", "745", "", "0", "20", "7.45.0"))
print(live_request().add_live_service("745", "560641", "7.45.0")) # print(live_request().add_live_service("745", "560641", "7.45.0"))
print(live_request().delete_live_service("745", "7242", "7.45.0")) # print(live_request().delete_live_service("745", "7242", "7.45.0"))
\ No newline at end of file print(live_request().m_get_channel_status("745", "7.46.0"))
\ No newline at end of file
...@@ -78,4 +78,15 @@ delete_live_gift: ...@@ -78,4 +78,15 @@ delete_live_gift:
json: {} json: {}
isLogin: 1 isLogin: 1
#获取直播间状态
m_get_channel_status:
method: GET
url: /api/janus/live/m/get_channel_status
params:
channel_id: ${channel_id}
version: ${version}
data: {}
json: {}
isLogin: 1
...@@ -21,6 +21,19 @@ class living_request(BaseRequest): ...@@ -21,6 +21,19 @@ class living_request(BaseRequest):
self.params["device_type"] = device_type self.params["device_type"] = device_type
return self.api_send(self.data["pushlive_info"]) return self.api_send(self.data["pushlive_info"])
#观众进入直播间
def enter(self,channel_id, from_source, version, device_id="97B6764B-2135-4761-9911-701C38CBC272"):
self.params["channel_id"] = channel_id
self.params["from_source"] = from_source
self.params["version"] = version
return self.api_send(self.data["enter"])
#观众离开直播间
def leave(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["leave"])
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -24,30 +24,25 @@ pushlive_info: ...@@ -24,30 +24,25 @@ pushlive_info:
json: {} json: {}
isLogin: 1 isLogin: 1
#主播-推荐袋美购列表展示 #观众进入直播间
live_services: enter:
method: GET method: get
url: /api/janus/live/live_services url: /api/live/enter
params: params:
channel_id: ${channel_id} channel_id: ${channel_id}
stream_id: ${stream_id} from_source: ${from_source}
offset: ${offset} version: ${version}
size: ${size}
data: {} data: {}
json: {} json: {}
isLogin: 1 isLogin: 1
#主播-推荐袋商品捜索功能 #观众离开直播间
search_services: leave:
method: GET method: get
url: /api/janus/live/search_services url: /api/live/leave
params: params:
current_city_id: ${current_city_id}
channel_id: ${channel_id} channel_id: ${channel_id}
query: ${query} version: ${version}
offset: ${offset}
size: ${size}
trace_id: ${trace_id}
data: {} data: {}
json: {} json: {}
isLogin: 1 isLogin: 1
......
...@@ -573,6 +573,18 @@ DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus ...@@ -573,6 +573,18 @@ DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus
DELETEGIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml") DELETEGIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
DELETEGIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "delete_live_gift.yaml") DELETEGIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "delete_live_gift.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")
#观众进入直播间
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")
#观众离开直播间
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")
#免费招募活动详情 #免费招募活动详情
FREE_RECRUIT_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml") FREE_RECRUIT_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
FREE_RECRUIT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "free_recruit_detail.yaml") FREE_RECRUIT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "free_recruit_detail.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 TestMGetChannelStatus:
data = BaseRequest().api_load(path_setting.M_GET_CHANNEL_STATUS)
m_get_channel_status_case, m_get_channel_status_data = get_ids(data, "m_get_channel_status")
@pytest.mark.parametrize("param", m_get_channel_status_data, ids=m_get_channel_status_case)
def test_m_get_channel_status_data(self, param):
print("查看直播状态啦~~~")
r = live_request().m_get_channel_status(param["channel_id"], param["version"])
if r["error"] == 0:
assert r["data"]["status"] == 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 TestEnter:
data = BaseRequest().api_load(path_setting.ENTER)
enter_case, enter_data = get_ids(data,"enter")
@pytest.mark.parametrize("param", enter_data, ids=enter_case)
def test_enter(self, param):
r = living_request().enter(param["channel_id"], param["from_source"], param["version"])
print("观众进入直播间啦~~~")
if r["error"] == 0:
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 TestLeave:
data = BaseRequest().api_load(path_setting.LEAVE)
leave_case, leave_data = get_ids(data,"leave")
@pytest.mark.parametrize("param", leave_data, ids=leave_case)
def test_leave(self, param):
r = living_request().leave(param["channel_id"], param["version"])
print("观众离开直播间了,呜呜呜")
if r["error"] == 0:
assert r["error"] == param["assert"]
\ No newline at end of file
m_get_channel_status:
#查看直播状态
-
case: "查看直播状态"
channel_id: "745"
version: "7.45.0"
assert : True
\ No newline at end of file
enter:
#观众从app进入直播间
-
case: "观众从app进入直播间"
channel_id: "745"
from_source: "app"
version: "7.45.0"
assert: 0
\ No newline at end of file
leave:
#观众离开直播间了,呜呜呜
-
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