import pytest

from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request


class TestCpcHomepage:
    data = BaseRequest().api_load(path_setting.CPCHOMEPAGE)
    cpchomepage_case, cpchomepage_data = get_ids(data, "cpc_homepage")


    @pytest.mark.parametrize("param",cpchomepage_data,ids=cpchomepage_case)
    def test_cpc_homepage(self, param):
        '''点点通-概览'''
        r = web_request().cpc_homepage()
        if r["error"] == 0:
            if r["data"]["account"] <= "0":
                assert r["data"]["is_cpc"] == param["assert"]
            else:
                assert r["data"]["is_cpc"] == param["assert1"]

