import pytest

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


class TestDoctorSubmechanisms:

    doctor_submechanisms = BaseRequest().api_load(path_setting.DOCTOR_DATA)
    DoctorSubmechanisms_case, DoctorSubmechanisms_data = get_ids(doctor_submechanisms, "doctor_submechanisms")

    @pytest.mark.parametrize("param",DoctorSubmechanisms_data,ids=DoctorSubmechanisms_case)
    def test_DoctorSubmechanisms_data(self,param):

        r = web_request().doctor_submechanisms()
        if r["error"] == 0:
            assert r["error"] == param["assert"]
        # elif r["error"] == 1:
        #     assert r["message"] == params["assert"]