Commit 2986b311 authored by edz's avatar edz

直播polling循环

parent 0f73d12f
...@@ -22,6 +22,9 @@ class janus_request(BaseRequest): ...@@ -22,6 +22,9 @@ class janus_request(BaseRequest):
#次卡商详页 #次卡商详页
self.data = self.api_load(path_setting.BEAUTY_CARD_DETAIL_CONFIG) self.data = self.api_load(path_setting.BEAUTY_CARD_DETAIL_CONFIG)
#直播polling循环
self.data = self.api_load(path_setting.POLLING_CONFIG)
#搜索结果页-综合/百科tab #搜索结果页-综合/百科tab
def content_v7(self, query, device_id, current_city_id, version, is_first, tab_type, offset): def content_v7(self, query, device_id, current_city_id, version, is_first, tab_type, offset):
#搜索词 #搜索词
...@@ -230,6 +233,13 @@ class janus_request(BaseRequest): ...@@ -230,6 +233,13 @@ class janus_request(BaseRequest):
return self.api_send(self.data["page_rules"]) return self.api_send(self.data["page_rules"])
#直播poling循环
def polling(self,stream_id,is_first):
self.params["stream_id"] = stream_id
self.params["is_first"] = is_first
return self.api_send(self.data["polling"])
if __name__ == '__main__': if __name__ == '__main__':
...@@ -303,6 +313,7 @@ if __name__ == '__main__': ...@@ -303,6 +313,7 @@ if __name__ == '__main__':
# print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0)) # print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0))
print(janus_request().beauty_card_order_detail(102247770691611)) print(janus_request().beauty_card_order_detail(102247770691611))
# print(janus_request().product_my_list(0, 0)) # print(janus_request().product_my_list(0, 0))
#直播-点击【设置封面】 #直播-点击【设置封面】
print("直播-点击【设置封面】") print("直播-点击【设置封面】")
print(janus_request().page_rules("744.2", "beijing", "post_add_pic")) print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
......
...@@ -312,3 +312,15 @@ feed_service: ...@@ -312,3 +312,15 @@ feed_service:
data: {} data: {}
json: {} json: {}
isLogin: 0 isLogin: 0
#直播polling循环
polling:
method: get
url: /api/janus/live/polling
params:
stream_id: ${stream_id}
is_first: ${is_first}
data: {}
json: {}
...@@ -524,5 +524,9 @@ FREE_RECRUIT_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_ ...@@ -524,5 +524,9 @@ FREE_RECRUIT_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_
PAGE_RULES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml") PAGE_RULES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
PAGE_RULES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "page_rules.yaml") PAGE_RULES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "page_rules.yaml")
#直播polling循环
POLLING_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
POLLING = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "polling.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.janus_request import janus_request
class TestPolling:
data = BaseRequest().api_load(path_setting.POLLING)
polling_case, polling_data = get_ids(data, "polling")
print('polling_data:',polling_data)
@pytest.mark.parametrize("param",polling_data,ids=polling_case)
def test_polling(self,param):
print(param)
r = janus_request().polling(param["stream_id"],param["is_first"])
print(r)
if r["error"] == 0:
assert r["data"]["delay"] == param["assert"]
\ No newline at end of file
#polling_vfc:
polling:
#循环成功
-
case: "polling循环成功"
stream_id: "2334"
is_first: "0"
assert: 10
\ 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