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 TestExportRelatedBc:
    data = BaseRequest().api_load(path_setting.EXPORT_RELATED_BC)
    export_related_bc_case, export_related_bc_data = get_ids(data, "export_related_bc")

    @pytest.mark.parametrize("param",export_related_bc_data,ids=export_related_bc_case)
    def test_export_related_bc(self,param):
        r = beautycard_request().export_related_bc(param["unit_id"], param["bc_sku_id"], param["bc_spu_id"])
        if r["data"]:
            print("成功导出已添加页面次卡信息")
            assert len(r["data"]["beauty_cards"]) != param["assert"]
        if not r["data"]:
            print("未导出已添加页面次卡信息")