import pytest

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


class TestDiaryPreCreateTop:
    data = BaseRequest().api_load(path_setting.DIARY_PRE_CREATE_TOPIC_DATE)
    diary_pre_create_topic_case, diary_pre_create_topic_data = get_ids(data, "pre_create_topic")
    @pytest.mark.parametrize("param", diary_pre_create_topic_data, ids=diary_pre_create_topic_case)
    def test_diary_pre_create_topic(self, param):
        r = diary_request().diary_pre_create_topic(param["diary_id"])
        # result = diary_request().diary_operation()
        if r["error"] == 1:
            assert r["message"] == param["assert"]
        # if r["error"] == 1:
        #     assert r["message"] ==param["assert2"]



#


