import pytest

from all_backend_api.service_request import service_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest


class TestServiceFavor:
    data = BaseRequest().api_load(path_setting.SERVICE_FAVOR)
    service_favor_case, service_favor_data = get_ids(data, "service_favor")

    @pytest.mark.parametrize("param", service_favor_data, ids=service_favor_case)
    def test_service_favor(self, param):
        r = service_request().service_favor()

        if r["error"] == 0:
            assert r["message"] == param["assert_message"]

        print(service_request().service_favor())

