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 TestPayV1:
    data = BaseRequest().api_load(path_setting.PAY_V1)
    pay_case, pay_data = get_ids(data, "pay_v1")

    @pytest.mark.parametrize("param", pay_data, ids=pay_case)
    def test_pay_v1(self, param):
        r = settlement_request().pay_v1(param["actual_pay"],param["payment_final_price"],param["is_contains_groupbuy_order"],param["mul_orders_number"])
        print(r)
        assert r["error"] == param["assert"]

