import pytest

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


class TestList:
    data = BaseRequest().api_load(path_setting.SHOPCART_LIST)
    list_case, list_data = get_ids(data, "list")

    # @pytest.mark.skip
    @pytest.mark.parametrize("param", list_data, ids=list_case)
    def test_list(self, param):
        r = shopcart_request().list()
        print("返回结果", r)
        if r["error"] == 0:
            assert r["error"] == param["assert_error"]
