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 TestLiveServices:
    data = BaseRequest().api_load(path_setting.LIVESERVICES)
    liveservices_case, liveservices_data = get_ids(data, "live_services")

    @pytest.mark.parametrize("param", liveservices_data, ids=liveservices_case)
    def test_live_services(self, param):
        print(111111111111111111111)
        r = live_request().live_services(param["channel_id"], param["stream_id"], param["offset"], param["size"])
        if r["error"] == 0:
            assert r["data"]["offset"] == param["assert"]