import pytest

import path_setting
from all_backend_api.janus_live_request import live_request
from all_backend_api.live_request import living_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("查看直播状态啦~~~")
        living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1")
        r = live_request().m_get_channel_status(param["channel_id"], param["version"])
        if r["error"] == 0:
            assert r["data"]["status"] == param["assert"]