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 TestDoctorRegisterPost:

    data = BaseRequest().api_load(path_setting.DOCTOR_REGISTER_POST)
    doctor_register_post_case, doctor_register_post_data = get_ids(data, "doctor_register_post")

    @pytest.mark.parametrize("param",doctor_register_post_data,ids=doctor_register_post_case)
    def test_doctor_register(self,param):
        r = web_request().doctor_register_post(param["profession_licences"],
                                               param["b_licences"],
                                               param["p_licences"],
                                               param["personal_pictures"],
                                               param["register_phone"],
                                               param["verification_code"])
        # if r["error"] == 0:
        assert r["data"]['code'] == param["code"]
        assert r["data"]['message'] == param["message"]

