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 TestPushLiveInfo:
    data = BaseRequest().api_load(path_setting.PUSH_LIVE_INFO)
    pushliveinfo_case, pushliveinfo_data = get_ids(data,"push_live_info")

    @pytest.mark.parametrize("param", pushliveinfo_data, ids=pushliveinfo_case)
    def test_pushlive_info(self, param):

        r = living_request().pushlive_info(param["title"],param["cover_url"],param["notice"],param["tag_id"],param["clarity"],param["device_type"])
        print('--------',r)
        if r["error"] == 0:
            assert r["error"] == param["assert"]
        else:
            assert r["message"] == param['assert_message0']