Commit e8ca6669 authored by edz's avatar edz

Merge branch 'crk_dev' into common_dev

parents a78f445f 4f77bd45
import path_setting
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
self.params["msg_id"] = msg_id
self.params["user_id"] = user_id
return self.api_send(self.data["danmu_v2"])
if __name__ == '__main__':
(living_request().danmu_v2("739","1",""))
\ No newline at end of file
danmu_v2:
method: get
url: /api/live/danmu_v2
params:
channel_id: ${channel_id}
msg_id: ${msg_id}
user_id: ${user_id}
data: {}
json: {}
\ No newline at end of file
......@@ -8,6 +8,7 @@ LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_func
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_data_request.yaml")
DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "diary_data.yaml")
......@@ -62,6 +63,12 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
HOME_V5_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "service_request.yaml")
HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","home_v5.yaml")
#直播
LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
#直播-获取弹幕
DANMU_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "danmu_v2.yaml")
if __name__ == '__main__':
print("==========",HOSTYAML_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.live_request import living_request
class TestDanmuV2:
data = BaseRequest().api_load(path_setting.DANMU_V2)
danmuv2_case, danmuv2_data = get_ids(data, "danmu_v2")
@pytest.mark.parametrize("param",danmuv2_data,ids=danmuv2_case)
def test_danmu_v2(self,param):
print(param)
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
danmu_v2:
#成功获取弹幕case
-
case: "成功获取弹幕"
channel_id: "739"
msg_id: 1
user_id: ""
assert: 0
#获取弹幕失败case
-
case: "获取弹幕失败-进入房间失败"
channel_id: ""
msg_id: 1
user_id: ""
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