import pytest

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


class TestDiaryCancelfavor:
    data = BaseRequest().api_load(path_setting.DIARY_CANCELFAVOR)
    diary_cancelfavor_case, diary_cancelfavor_data = get_ids(data, "diary_cancelfavor")

    @pytest.mark.parametrize("param", diary_cancelfavor_data, ids=diary_cancelfavor_case)
    def test_diary_cancelfavor(self, param):
        r = diary_cancelfavor_request().diary_cancelfavor()
        # print(r)
        if r["error"] == 0:
            assert r["message"] == param["assert"]
        assert r["message"] ==param["assert2"]







