import pytest

import path_setting
from all_backend_api.visual_beauty_card import visual_beauty_card_request
from ids_list import get_ids
from in_common.base_request import BaseRequest

#次卡商品列表组件商品
class TestBeautyCardSkus:
    data = BaseRequest().api_load(path_setting.BEAUTYCARD_SKUS)
    beautycard_skus_case, beautycard_skus_data = get_ids(data, "beautycard_skus")

    @pytest.mark.parametrize("param", beautycard_skus_data, ids=beautycard_skus_case)
    def test_beautycard_skus(self, param):
        print('次卡商品列表组件商品')
        r = visual_beauty_card_request().beautycard_skus(param["unit_id"], param["tag_id"], param["area"], param["sort_type"], param["page"], param["page_size"])
        if r["data"]:
            print('次卡商品列表组件有商品召回')
            assert len(r["data"]["beautycards"]) != param["assert"]