import pytest

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


class TestFavor:
    data = BaseRequest().api_load(path_setting.QA_FAVOR)
    test_case, test_data = get_ids(data, "favor")

    # @pytest.mark.skip
    @pytest.mark.parametrize("param", test_data, ids=test_case)
    def test_favor(self, param):
        r = qa_request().favor(param["answer_id"])
        print("返回结果", r)
        assert r["error"] == param["error"]

        r = qa_request().cancelfavor(param["answer_id"])
        assert r["error"] == param["error"]











