import pytest

from all_backend_api.hospital_request import hospital_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.HOSPITAL_DIARY)
    diary_case, diary_data = get_ids(data, "diary")

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