# Path: tests/unit/test.py
# class TestCase(testtools.TestCase):
#     def setUp(self):
#     def mock_config(self, update=None):
#     def post(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def get(self, *args, **kwargs):


import mock
from tests.unit import test
                "bar": {"availability": 24, "health": None,
                        "performance": None, "sla": None},
                "foo": {"availability": None, "health": 42,
                        "performance": None, "sla": None}
            }
        }
        self.assertEqual(expected, resp)

    @mock.patch("ceagle.api.v1.status.client.get_client")
    def test_get_region_status(self, mock_client):
        health_resp = {"health": {"foo": {"fci": 42}}}
        mock_health_client = mock.Mock()
        mock_health_client.get.return_value = (health_resp, 200)

        avail_resp = {"availability": {"bar": {"availability": 24}}}
        mock_avail_client = mock.Mock()
        mock_avail_client.get.return_value = (avail_resp, 200)
        mock_client.side_effect = [mock_health_client, mock_avail_client]

        uri = "/api/v1/region/foo_region/status/day"
        code, resp = self.get(uri)
        self.assertEqual(200, code)
        mock_health_client.get.assert_called_once_with(
            "/api/v1/region/foo_region/health/day")
        mock_avail_client.get.assert_called_once_with(
            "/api/v1/region/foo_region/availability/day")
        expected = {
            "period": "day",
            "status": {
                "bar": {"availability": 24, "health": None,

# Path: tests/unit/test.py
# class TestCase(testtools.TestCase):
#     def setUp(self):
#     def mock_config(self, update=None):
#     def post(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def get(self, *args, **kwargs):


# Path: tests/unit/api/v1/test_status.py
import mock
from tests.unit import test

                "bar": {"availability": 24, "health": None,
                        "performance": None, "sla": None},
                "foo": {"availability": None, "health": 42,
                        "performance": None, "sla": None}
            }
        }
        self.assertEqual(expected, resp)

    @mock.patch("ceagle.api.v1.status.client.get_client")
    def test_get_region_status(self, mock_client):
        health_resp = {"health": {"foo": {"fci": 42}}}
        mock_health_client = mock.Mock()
        mock_health_client.get.return_value = (health_resp, 200)

        avail_resp = {"availability": {"bar": {"availability": 24}}}
        mock_avail_client = mock.Mock()
        mock_avail_client.get.return_value = (avail_resp, 200)
        mock_client.side_effect = [mock_health_client, mock_avail_client]

        uri = "/api/v1/region/foo_region/status/day"
        code, resp = self.get(uri)
        self.assertEqual(200, code)
        mock_health_client.get.assert_called_once_with(
            "/api/v1/region/foo_region/health/day")
        mock_avail_client.get.assert_called_once_with(
            "/api/v1/region/foo_region/availability/day")
        expected = {
            "period": "day",
            "status": {
                "bar": {"availability": 24, "health": None,

                        "performance": None, "sla": None},