import pytest

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


class TestPreviewV1:
    data = BaseRequest().api_load(path_setting.PREVIEW)
    preview_case, preview_data = get_ids(data, "preview_v1")

    @pytest.mark.parametrize("param", preview_data, ids=preview_case)
    def test_preview_v1(self, param):
        r = settlement_request().preview_v1(param["current_city_id"],param["service_item_id"],param["number"],param["use_platform_coupon"],param["use_doctor_coupon"],param["use_coupon_grey"],param["is_create_groupbuy"])
        print(r)
        assert r["error"] == param["assert"]

