import pytest

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


class TestServiceRegister:
    service_register = BaseRequest().api_load(path_setting.REGISTER_DATA)
    ServiceRegister_case, ServiceRegister_data = get_ids(service_register, "service_register")

    @pytest.mark.parametrize("params",ServiceRegister_data,ids=ServiceRegister_case)
    def test_ServiceRegister(self,params):

        r =glmer_request().service_register(params['name'],params['project_type'],params['upgrade'],params['short_description'],params['doctor_id'],params['start_time'],params['end_time'],params['photo_details'],params['image_header'],params['video_token'],params['service_type'],params['is_specialreview'],params['reservation'],params['have_extra_pay'],params['is_draft'],params['items'],params['csrfmiddlewaretoken'])

        if r["code"] == 0:
            assert r["code"] == params["assert"]
        # elif r["error"] == 1:
        #     assert r["message"] == params["assert"]