import pytest

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


class TestServiceOffline:

    service_offline = BaseRequest().api_load(path_setting.OFFLINE_DATA)
    ServiceOffline_case, ServiceOffline_data = get_ids(service_offline, "service_offline")

    @pytest.mark.parametrize("params",ServiceOffline_data,ids=ServiceOffline_case)
    def test_ServiceOffline_data(self,params):

        r = web_request().service_offline(params['id'],params['csrfmiddlewaretoken'])
        print("=======",r)
        if r["error"] == 0:
            assert r["error"] == params["assert"]
