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 TestShareClick:
    data = BaseRequest().api_load(path_setting.SHARE_CLICK)
    share_click_case,  share_click_data = get_ids(data, "share_click")

    @pytest.mark.parametrize("param", share_click_data, ids=share_click_case)
    def test_share_click(self, param):
        r = live_request().share_click(param["stream_id"], param["share_channel"],)
        if r["error"] == 0:
            assert r["error"] == param["assert"]
        else:
            assert r["error"] == param["assert"]