# 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 json
from tests.unit import test
        for uri in ("/api/v1/region/%s/runbooks" % region,
                    "/api/v1/region/%s/runbooks/%s" % (region, runbook_id),
                    "/api/v1/region/%s/runbook_runs" % region,
                    "/api/v1/region/%s/runbook_runs/%s" % (region, run_id)):
            code_, resp = self.get(uri)
            self.assertEqual(200, code_)

        correct_runbook = {
            "name": "test",
            "description": "test",
            "type": "bash",
            "runbook": "echo",
        }
        correct_runbook = json.dumps(correct_runbook)
        incorrect_runbook = json.dumps({})

        # runbooks
        url = "/api/v1/region/%s/runbooks" % region
        code_, resp = self.post(url, data=correct_runbook,
                                content_type='application/json')
        self.assertEqual(201, code_)

        url = "/api/v1/region/%s/runbooks" % region
        code_, resp = self.post(url, data=incorrect_runbook,
                                content_type='application/json')
        self.assertEqual(400, code_)

        # single runbook
        url = "/api/v1/region/%s/runbooks/%s" % (region, runbook_id)
        code_, resp = self.put(url, data=correct_runbook,

# 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_fake_api.py
import json
from tests.unit import test

        for uri in ("/api/v1/region/%s/runbooks" % region,
                    "/api/v1/region/%s/runbooks/%s" % (region, runbook_id),
                    "/api/v1/region/%s/runbook_runs" % region,
                    "/api/v1/region/%s/runbook_runs/%s" % (region, run_id)):
            code_, resp = self.get(uri)
            self.assertEqual(200, code_)

        correct_runbook = {
            "name": "test",
            "description": "test",
            "type": "bash",
            "runbook": "echo",
        }
        correct_runbook = json.dumps(correct_runbook)
        incorrect_runbook = json.dumps({})

        # runbooks
        url = "/api/v1/region/%s/runbooks" % region
        code_, resp = self.post(url, data=correct_runbook,
                                content_type='application/json')
        self.assertEqual(201, code_)

        url = "/api/v1/region/%s/runbooks" % region
        code_, resp = self.post(url, data=incorrect_runbook,
                                content_type='application/json')
        self.assertEqual(400, code_)

        # single runbook
        url = "/api/v1/region/%s/runbooks/%s" % (region, runbook_id)
        code_, resp = self.put(url, data=correct_runbook,

                               content_type='application/json')