# Path: monasca_notification/notification.py
# class Notification(object):
#     def __init__(self, id, type, name, address, period, retry_count, alarm):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def to_json(self):
# 
# Path: monasca_notification/plugins/webhook_notifier.py
# CONF = cfg.CONF
# class WebhookNotifier(abstract_notifier.AbstractNotifier):
#     def __init__(self, log):
#     def config(self, config_dict):
#     def statsd_name(self):
#     def send_notification(self, notification):
# def register_opts(conf):
# def list_opts():
# 
# 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):


import requests
import simplejson as json
import queue
from unittest import mock
from monasca_notification import notification as m_notification
from monasca_notification.plugins import webhook_notifier
from tests import base

def alarm(metrics):
    return {"tenantId": "0",
            "alarmId": "0",
            "alarmDefinitionId": 0,
            "alarmName": "test Alarm",
            "alarmDescription": "test Alarm description",
            "oldState": "OK",
            "newState": "ALARM",
            "severity": "LOW",
            "link": "some-link",
            "lifecycleState": "OPEN",
            "stateChangeReason": "I am alarming!",
            "timestamp": 1429023453632,
            "metrics": metrics}


class requestsResponse(object):
    def __init__(self, status):
        self.status_code = status


class TestWebhook(base.PluginTestCase):

    def setUp(self):
        super(TestWebhook, self).setUp(webhook_notifier.register_opts)
        self.trap = queue.Queue()

    def tearDown(self):
        super(TestWebhook, self).tearDown()

# Path: monasca_notification/notification.py
# class Notification(object):
#     def __init__(self, id, type, name, address, period, retry_count, alarm):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def to_json(self):
# 
# Path: monasca_notification/plugins/webhook_notifier.py
# CONF = cfg.CONF
# class WebhookNotifier(abstract_notifier.AbstractNotifier):
#     def __init__(self, log):
#     def config(self, config_dict):
#     def statsd_name(self):
#     def send_notification(self, notification):
# def register_opts(conf):
# def list_opts():
# 
# 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_webhook_notification.py
import requests
import simplejson as json
import queue
from unittest import mock
from monasca_notification import notification as m_notification
from monasca_notification.plugins import webhook_notifier
from tests import base


def alarm(metrics):
    return {"tenantId": "0",
            "alarmId": "0",
            "alarmDefinitionId": 0,
            "alarmName": "test Alarm",
            "alarmDescription": "test Alarm description",
            "oldState": "OK",
            "newState": "ALARM",
            "severity": "LOW",
            "link": "some-link",
            "lifecycleState": "OPEN",
            "stateChangeReason": "I am alarming!",
            "timestamp": 1429023453632,
            "metrics": metrics}


class requestsResponse(object):
    def __init__(self, status):
        self.status_code = status


class TestWebhook(base.PluginTestCase):

    def setUp(self):
        super(TestWebhook, self).setUp(webhook_notifier.register_opts)
        self.trap = queue.Queue()

    def tearDown(self):
        super(TestWebhook, self).tearDown()

        self.assertTrue(self.trap.empty())