import pytest

import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest

#更美次卡-获取已添加页面次卡spu/sku列表
class TestGetRelatedBc:
    data = BaseRequest().api_load(path_setting.GET_RELATED_BC)
    get_related_bc_case, get_related_bc_data = get_ids(data, "get_related_bc")

    @pytest.mark.parametrize("param",get_related_bc_data,ids=get_related_bc_case)
    def test_get_related_bc(self,param):
        r = beautycard_request().get_related_bc(param["unit_id"], param["bc_sku_id"], param["bc_spu_id"], param["page"], param["page_size"])
        if r["data"]:
            print("成功获取已添加页面次卡spu/sku列表")
            assert len(r["data"]["beauty_cards"]) != param["assert"]
        if not r["data"]:
            print("未获取到已添加页面次卡spu/sku列表")