import pytest

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


class TestDiaryUpdate:
    data = BaseRequest().api_load(path_setting.DIARY_UPDATE)
    diary_update_case, diary_update_data = get_ids(data, "diary_update")

    @pytest.mark.parametrize("param", diary_update_data, ids=diary_update_case)
    def test_diary_update(self, param):
        r = diary_update_request().diary_update(param["topic_list"])
        # print(r)
        # if r["error"] == 0:
        #     assert r["message"] == param["assert"]
        if r["error"] == 1:
            assert r["message"] == param["assert"]


        #     收藏之后取消收藏
        # r1 = diary_isfavor_request().diary_cancelfavor()
        # if r["error"] == 0:
        #     assert r["error"] == param["assert"]






