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 TestAddLiveService:
    data = BaseRequest().api_load(path_setting.ADDLIVESERVICE)
    addliveservice_case, addliveservice_data = get_ids(data, "add_live_service")

    @pytest.mark.parametrize("param", addliveservice_data, ids=addliveservice_case)
    def test_add_live_service(self, param):
        print(111111111111111111111)
        r = live_request().add_live_service(param["channel_id"], param["service_item_ids"], param["version"])
        if r["error"] == 0:
            assert r["data"]["toast"] == param["assert"]