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 TestCpcCommunityPromoteFlows:
    data = BaseRequest().api_load(path_setting.CPCCOMMUNITYPROMOTEFLOWS)
    cpccommunitypromoteflows_case, cpccommunitypromoteflows_data = get_ids(data, "cpc_community_promote_flows")


    @pytest.mark.parametrize("param",cpccommunitypromoteflows_data,ids=cpccommunitypromoteflows_case)
    def test_cpc_community_promote_flows(self, param):
        '''点点通商品-历史每月推广明细-导出'''
        r = web_request().cpc_community_promote_flows(param["month"])
        if r["error"] == 0:
            flows_list = r.get("data").get("flows_list", [])
            assert len(flows_list) >= param["assert"]



