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 TestLeave:
    data = BaseRequest().api_load(path_setting.LEAVE)
    leave_case, leave_data = get_ids(data,"leave")

    @pytest.mark.parametrize("param", leave_data, ids=leave_case)
    def test_leave(self, param):
        r = living_request().leave(param["channel_id"], param["version"])
        print("观众离开直播间了，呜呜呜")
        if r["error"] == 0:
            assert r["error"] == param["assert"]