import pytest

import path_setting
from all_doctor_api.web2_request import web2_request
from ids_list import get_ids
from in_common.base_request import BaseRequest


class TestServicereviewOption:

    servicereview_option = BaseRequest().api_load(path_setting.SERVICEREVIEW_OPTION_DATA)
    ServicereviewOption_case, ServicereviewOption_data = get_ids(servicereview_option, "servicereview_option")

    @pytest.mark.parametrize("params", ServicereviewOption_data, ids=ServicereviewOption_case)
    def test_ServicereviewOption(self, params):

        r = web2_request().servicereview_option(params['id'], params['type'], params['csrfmiddlewaretoken'])
        print("--------",r)

        if r["error"] == 0:
            assert r["error"] == params["assert"]
        print("....")

        # elif r["error"] == 1:
        #     assert r["data"] == params["assert"]