# Path: monasca_notification/common/utils.py
# LOG = log.getLogger(__name__)
# CONF = cfg.CONF
# NOTIFICATION_DIMENSIONS = {'service': 'monitoring',
#                            'component': 'monasca-notification'}
# def get_db_repo():
# def construct_notification_object(db_repo, notification_json):
# def grab_stored_notification_method(db_repo, notification_id):
# def get_statsd_client(dimensions=None):
#     def _set_connection(self, connection, host, port):
#     def __init__(self, host='localhost', port=8125, max_buffer_size=50):
#     def connect(self, host, port):
#     def _send_to_server(self, packet):
# def get_keystone_session():
# def get_auth_token():
# class OfflineClient(monascastatsd.Client):
# class OfflineConnection(monascastatsd.Connection):
# 
# Path: tests/base.py
# class DisableStatsdFixture(fixtures.Fixture):
# class ConfigFixture(oo_cfg.Config):
# class BaseTestCase(oslotest_base.BaseTestCase):
# class PluginTestCase(BaseTestCase):
#     def setUp(self):
#     def __init__(self):
#     def setUp(self):
#     def _clean_config_loaded_flag():
#     def setUp(self):
#     def conf_override(**kw):
#     def conf_default(**kw):
#     def setUp(self, register_opts=None):


from unittest.mock import patch
from monasca_notification.common import utils
from tests import base
# Copyright 2016-2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      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.




class TestStatsdConnection(base.BaseTestCase):
    extra_dimensions = {'foo': 'bar'}
    base_name = 'monasca'

    def test_statsd_default_connection(self):
        with patch(
                'monasca_notification.common.utils.monascastatsd.Client') as c:
            utils.get_statsd_client()

# Path: monasca_notification/common/utils.py
# LOG = log.getLogger(__name__)
# CONF = cfg.CONF
# NOTIFICATION_DIMENSIONS = {'service': 'monitoring',
#                            'component': 'monasca-notification'}
# def get_db_repo():
# def construct_notification_object(db_repo, notification_json):
# def grab_stored_notification_method(db_repo, notification_id):
# def get_statsd_client(dimensions=None):
#     def _set_connection(self, connection, host, port):
#     def __init__(self, host='localhost', port=8125, max_buffer_size=50):
#     def connect(self, host, port):
#     def _send_to_server(self, packet):
# def get_keystone_session():
# def get_auth_token():
# class OfflineClient(monascastatsd.Client):
# class OfflineConnection(monascastatsd.Connection):
# 
# Path: tests/base.py
# class DisableStatsdFixture(fixtures.Fixture):
# class ConfigFixture(oo_cfg.Config):
# class BaseTestCase(oslotest_base.BaseTestCase):
# class PluginTestCase(BaseTestCase):
#     def setUp(self):
#     def __init__(self):
#     def setUp(self):
#     def _clean_config_loaded_flag():
#     def setUp(self):
#     def conf_override(**kw):
#     def conf_default(**kw):
#     def setUp(self, register_opts=None):


# Path: tests/test_utils.py
from unittest.mock import patch
from monasca_notification.common import utils
from tests import base

# Copyright 2016-2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      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.




class TestStatsdConnection(base.BaseTestCase):
    extra_dimensions = {'foo': 'bar'}
    base_name = 'monasca'

    def test_statsd_default_connection(self):
        with patch(
                'monasca_notification.common.utils.monascastatsd.Client') as c:
            utils.get_statsd_client()

            c.assert_called_once_with(dimensions=utils.NOTIFICATION_DIMENSIONS,