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 TestSearchService:
    data = BaseRequest().api_load(path_setting.SEARCHSERVICE)
    searchservice_case,  searchservice_data = get_ids(data, "search_service")

    @pytest.mark.parametrize("param", searchservice_data, ids=searchservice_case)
    def test_search_service(self, param):
        print(111111111111111111111)
        r = live_request().search_service(param["current_city_id"], param["channel_id"], param["query"], param["offset"], param["size"], param["version"])
        if r["error"] == 0:
            assert r["data"]["services"] != param["assert"]