import pytest

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


class TestDiary:
    data = BaseRequest().api_load(path_setting.DOCTOR_DIARY)
    diary_case, diary_data = get_ids(data, "diary")

    @pytest.mark.parametrize("param", diary_data, ids=diary_case)
    def test_diary(self, param):
        r = doctor_request().diary(param["doctor_id"])
        print("返回结果", r)
        if r["error"] == 0:
            assert r["error"] == param["assert_error"]
