import pytest

import path_setting
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
from in_common.base_request import BaseRequest


class TestResourceBit:
    data = BaseRequest().api_load(path_setting.RESOURCE_BIT)
    resource_bit_case, resource_bit_data = get_ids(data, "resource_bit")
    @pytest.mark.parametrize("param", resource_bit_data, ids=resource_bit_case)

    def test_resource_bit(self,param):
        r = janus_request().resource_bit(param["current_city_id"], param["version"])
        if r["error"] ==0:
            assert r["data"]["pro_category"][0]["exposure"]["card_type"] == param["assert"]
            print("首页-品类聚合页icon接口正常哦")
        else:
            assert r["error"] == 99
            print("接口出错了")