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 TestVisualBeautyCardServices:
    data = BaseRequest().api_load(path_setting.VISUAL_BEAUTY_CARD_SERVICES)
    visual_beauty_card_services_case, visual_beauty_card_services_data = get_ids(data, "visual_beauty_card_services")

    @pytest.mark.parametrize("param", visual_beauty_card_services_data, ids=visual_beauty_card_services_case)
    def test_visual_beauty_card_services(self, param):
        print('次卡橱窗')
        r = visual_beauty_card_request().visual_beauty_card_services(param["unit_id"], param["current_city_id"], param["page"], param["page_size"], param["version"])
        if r["data"]["beautycards"]:
            print('次卡橱窗有商品')
            assert len(r["data"]["beautycards"]) != param["assert"]