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 TestLiveGifts:
    data = BaseRequest().api_load(path_setting.LIVEGIFTS)
    livegifts_case, livegifts_data = get_ids(data, "live_gifts")

    @pytest.mark.parametrize("param", livegifts_data, ids=livegifts_case)
    def test_live_gifts(self, param):
        print(111111111111111111111)
        r = live_request().live_gifts(param["channel_id"], param["gift_type"], param["stream_id"], param["offset"], param["size"])
        if r["error"] == 0:
            assert r["data"]["offset"] == param["assert"]