import pytest

from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_reqest


class TestDIARYDATA:
    data = BaseRequest().api_load(path_setting.DIARY_DATA)
    diary_data_case, diary_data_data = get_ids(data, "diary_data")

    @pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
    def test_diary_data(self,param):
        # print(2)
        r = diary_data_reqest().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
        # print(1)
        if r["error"] == 0:
            assert r["error"] == param["assert"]
            # assert(r[""])
        if r["error"] == 1:
            assert r["error"] == param["assert"]




