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

#更美次卡-按次卡sku_id导入，导入校验
class TestCheckSkuIds:
    data = BaseRequest().api_load(path_setting.CHECK_SKU_IDS)
    check_sku_ids_case, check_sku_ids_data = get_ids(data, "check_sku_ids")

    @pytest.mark.parametrize("param",check_sku_ids_data,ids=check_sku_ids_case)
    def test_check_sku_ids(self,param):
        r = beautycard_request().check_sku_ids(param["sku_ids"])
        if r["code"] == 0:
            if r["data"][0]["status"] == 1:
                print("成功导入次卡")
                assert r["data"][0]["reason"] == param["assert"]
            else:
                print("次卡不能成功导入")
                assert r["data"][0]["reason"] == param["assert"]
        if r["code"] == 1:
            print("接口有误")