# Path: magnum_ui/api/rest/magnum.py
# LOG = logging.getLogger(__name__)
# def change_to_id(obj):
#     def get(self, request):
#     def get(self, request):
#     def get(self, request, template_id):
#     def patch(self, request, template_id):
#     def get(self, request):
#     def delete(self, request):
#     def post(self, request):
#     def get(self, request, cluster_id):
#     def patch(self, request, cluster_id):
#     def get(self, request, cluster_id):
#     def post(self, request, cluster_id):
#     def post(self, request, cluster_id):
#     def get(self, request):
#     def delete(self, request):
#     def post(self, request):
#     def get(self, request, cluster_id):
#     def delete(self, request, cluster_id):
#     def post(self, request):
#     def get(self, request):
#     def get(self, request, project_id, resource):
#     def patch(self, request, project_id, resource):
#     def delete(self, request, project_id, resource):
#     def get(self, request):
#     def post(self, request):
#     def get(self, request):
# class IngressControllers(generic.View):
# class Addons(generic.View):
# class ClusterTemplate(generic.View):
# class ClusterTemplates(generic.View):
# class Cluster(generic.View):
# class ClusterResize(generic.View):
# class ClusterUpgrade(generic.View):
# class Clusters(generic.View):
# class Certificate(generic.View):
# class Certificates(generic.View):
# class Stats(generic.View):
# class Quota(generic.View):
# class Quotas(generic.View):
# class Networks(generic.View):
# 
# Path: magnum_ui/test/test_data.py
# def data(TEST):


from unittest import mock
from oslo_serialization import jsonutils
from magnum_ui.api.rest import magnum
from magnum_ui.test import test_data
from openstack_dashboard.test import helpers as test
from openstack_dashboard.test.test_data import utils
        test_cluster_template = TEST.cluster_templates.first()
        request = self.mock_rest_request(
            body='{"cluster_template_id":' +
                 str(test_cluster_template['uuid']) + '}')
        response = magnum.ClusterTemplates().delete(request)

        self.assertStatusCode(response, 204)
        client.cluster_template_delete.assert_called_once_with(
            request,
            u'cluster_template_id')

    # Clusters
    @mock.patch.object(magnum, 'magnum')
    def test_cluster_get(self, client):
        request = self.mock_rest_request()
        client.cluster_list.return_value = \
            mock_resource(TEST.clusters.list())
        response = magnum.Clusters().get(request)

        self.assertStatusCode(response, 200)
        self.assertItemsCollectionEqual(response, TEST.clusters.list())
        client.cluster_list.assert_called_once_with(request)

    @mock.patch.object(magnum, 'magnum')
    def test_cluster_create(self, client):
        test_clusters = mock_resource(TEST.clusters.list())
        test_cluster = test_clusters[0]
        test_body = jsonutils.dumps(test_cluster.to_dict())
        request = self.mock_rest_request(body=test_body)
        client.cluster_create.return_value = test_cluster

# Path: magnum_ui/api/rest/magnum.py
# LOG = logging.getLogger(__name__)
# def change_to_id(obj):
#     def get(self, request):
#     def get(self, request):
#     def get(self, request, template_id):
#     def patch(self, request, template_id):
#     def get(self, request):
#     def delete(self, request):
#     def post(self, request):
#     def get(self, request, cluster_id):
#     def patch(self, request, cluster_id):
#     def get(self, request, cluster_id):
#     def post(self, request, cluster_id):
#     def post(self, request, cluster_id):
#     def get(self, request):
#     def delete(self, request):
#     def post(self, request):
#     def get(self, request, cluster_id):
#     def delete(self, request, cluster_id):
#     def post(self, request):
#     def get(self, request):
#     def get(self, request, project_id, resource):
#     def patch(self, request, project_id, resource):
#     def delete(self, request, project_id, resource):
#     def get(self, request):
#     def post(self, request):
#     def get(self, request):
# class IngressControllers(generic.View):
# class Addons(generic.View):
# class ClusterTemplate(generic.View):
# class ClusterTemplates(generic.View):
# class Cluster(generic.View):
# class ClusterResize(generic.View):
# class ClusterUpgrade(generic.View):
# class Clusters(generic.View):
# class Certificate(generic.View):
# class Certificates(generic.View):
# class Stats(generic.View):
# class Quota(generic.View):
# class Quotas(generic.View):
# class Networks(generic.View):
# 
# Path: magnum_ui/test/test_data.py
# def data(TEST):


# Path: magnum_ui/test/api_tests/test_rest_api.py
from unittest import mock
from oslo_serialization import jsonutils
from magnum_ui.api.rest import magnum
from magnum_ui.test import test_data
from openstack_dashboard.test import helpers as test
from openstack_dashboard.test.test_data import utils

        test_cluster_template = TEST.cluster_templates.first()
        request = self.mock_rest_request(
            body='{"cluster_template_id":' +
                 str(test_cluster_template['uuid']) + '}')
        response = magnum.ClusterTemplates().delete(request)

        self.assertStatusCode(response, 204)
        client.cluster_template_delete.assert_called_once_with(
            request,
            u'cluster_template_id')

    # Clusters
    @mock.patch.object(magnum, 'magnum')
    def test_cluster_get(self, client):
        request = self.mock_rest_request()
        client.cluster_list.return_value = \
            mock_resource(TEST.clusters.list())
        response = magnum.Clusters().get(request)

        self.assertStatusCode(response, 200)
        self.assertItemsCollectionEqual(response, TEST.clusters.list())
        client.cluster_list.assert_called_once_with(request)

    @mock.patch.object(magnum, 'magnum')
    def test_cluster_create(self, client):
        test_clusters = mock_resource(TEST.clusters.list())
        test_cluster = test_clusters[0]
        test_body = jsonutils.dumps(test_cluster.to_dict())
        request = self.mock_rest_request(body=test_body)
        client.cluster_create.return_value = test_cluster

        response = magnum.Clusters().post(request)