# Path: monitoring/overview/views.py
# LOG = logging.getLogger(__name__)
# STATUS_FA_ICON_MAP = {'btn-success': "fa-check",
#                       'btn-danger': "fa-exclamation-triangle",
#                       'btn-warning': "fa-exclamation",
#                       'btn-default': "fa-question-circle"}
# def get_icon(status):
# def get_dashboard_links(request):
# def get_monitoring_services(request):
# def show_by_dimension(data, dim_name):
# def get_status(alarms):
# def generate_status(request):
#     def get_context_data(self, **kwargs):
#     def _convert_dimensions(self, req_kwargs):
#     def get(self, request, *args, **kwargs):
#     def get(self, request, *args, **kwargs):
#     def __init__(self, method, url, **kwargs):
#     def get_method(self):
# def proxy_stream_generator(response):
#     def read(self, method, url, data, headers):
#     def dispatch(self, request, url):
#     def get_relative_url(self, url):
#     def get_absolute_url(self, url):
#     def _can_access_kibana(self):
# class IndexView(TemplateView):
# class MonascaProxyView(TemplateView):
# class StatusView(TemplateView):
# class _HttpMethodRequest(urllib.request.Request):
# class KibanaProxyView(generic.View):
# 
# Path: monitoring/test/helpers.py
# class MonitoringTestsMixin(object):
# class TestCase(MonitoringTestsMixin, helpers.TestCase):
# class BaseAdminViewTests(MonitoringTestsMixin, helpers.BaseAdminViewTests):
# class APITestCase(MonitoringTestsMixin, helpers.APITestCase):
#     def _setup_test_data(self):


from django.test import RequestFactory
from django.test.utils import override_settings
from django.urls import reverse
from monitoring.overview import constants
from monitoring.overview import views
from monitoring.test import helpers
        from urllib import parse as urlparse
#       http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations
#  under the License.




INDEX_URL = reverse(
    constants.URL_PREFIX + 'index')


class OverviewTest(helpers.TestCase):

    @override_settings(DASHBOARDS=[],
                       KIBANA_POLICY_SCOPE='monitoring',
                       KIBANA_POLICY_RULE='monitoring:kibana_access',
                       ENABLE_LOG_MANAGEMENT_BUTTON=False,
                       ENABLE_EVENT_MANAGEMENT_BUTTON=False,
                       SHOW_GRAFANA_HOME=True)
    def test_index_get(self):
        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(
            res, 'monitoring/overview/index.html')
        self.assertTemplateUsed(res, 'monitoring/overview/monitor.html')



# Path: monitoring/overview/views.py
# LOG = logging.getLogger(__name__)
# STATUS_FA_ICON_MAP = {'btn-success': "fa-check",
#                       'btn-danger': "fa-exclamation-triangle",
#                       'btn-warning': "fa-exclamation",
#                       'btn-default': "fa-question-circle"}
# def get_icon(status):
# def get_dashboard_links(request):
# def get_monitoring_services(request):
# def show_by_dimension(data, dim_name):
# def get_status(alarms):
# def generate_status(request):
#     def get_context_data(self, **kwargs):
#     def _convert_dimensions(self, req_kwargs):
#     def get(self, request, *args, **kwargs):
#     def get(self, request, *args, **kwargs):
#     def __init__(self, method, url, **kwargs):
#     def get_method(self):
# def proxy_stream_generator(response):
#     def read(self, method, url, data, headers):
#     def dispatch(self, request, url):
#     def get_relative_url(self, url):
#     def get_absolute_url(self, url):
#     def _can_access_kibana(self):
# class IndexView(TemplateView):
# class MonascaProxyView(TemplateView):
# class StatusView(TemplateView):
# class _HttpMethodRequest(urllib.request.Request):
# class KibanaProxyView(generic.View):
# 
# Path: monitoring/test/helpers.py
# class MonitoringTestsMixin(object):
# class TestCase(MonitoringTestsMixin, helpers.TestCase):
# class BaseAdminViewTests(MonitoringTestsMixin, helpers.BaseAdminViewTests):
# class APITestCase(MonitoringTestsMixin, helpers.APITestCase):
#     def _setup_test_data(self):


# Path: monitoring/overview/tests.py
from django.test import RequestFactory
from django.test.utils import override_settings
from django.urls import reverse
from monitoring.overview import constants
from monitoring.overview import views
from monitoring.test import helpers
        from urllib import parse as urlparse

#       http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations
#  under the License.




INDEX_URL = reverse(
    constants.URL_PREFIX + 'index')


class OverviewTest(helpers.TestCase):

    @override_settings(DASHBOARDS=[],
                       KIBANA_POLICY_SCOPE='monitoring',
                       KIBANA_POLICY_RULE='monitoring:kibana_access',
                       ENABLE_LOG_MANAGEMENT_BUTTON=False,
                       ENABLE_EVENT_MANAGEMENT_BUTTON=False,
                       SHOW_GRAFANA_HOME=True)
    def test_index_get(self):
        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(
            res, 'monitoring/overview/index.html')
        self.assertTemplateUsed(res, 'monitoring/overview/monitor.html')



class KibanaProxyViewTest(helpers.TestCase):