# Path: bgpvpn_dashboard/api/bgpvpn.py
# LOG = logging.getLogger(__name__)
# class Bgpvpn(neutron.NeutronAPIDictWrapper):
# class NetworkAssociation(neutron.NeutronAPIDictWrapper):
# class RouterAssociation(neutron.NeutronAPIDictWrapper):
# def bgpvpns_list(request, **kwargs):
# def bgpvpn_get(request, bgpvpn_id, **kwargs):
# def bgpvpn_create(request, **kwargs):
# def bgpvpn_update(request, bgpvpn_id, **kwargs):
# def bgpvpn_delete(request, bgpvpn_id):
# def network_association_get(request, bgpvpn_id, network_assoc_id, **kwargs):
# def network_association_list(request, bgpvpn_id, **kwargs):
# def network_association_create(request, bgpvpn_id, **kwargs):
# def network_association_delete(request, resource_id, bgpvpn_id):
# def router_association_get(request, bgpvpn_id, router_assoc_id, **kwargs):
# def router_association_list(request, bgpvpn_id, **kwargs):
# def router_association_create(request, bgpvpn_id, **kwargs):
# def router_association_update(request, bgpvpn_id, router_association_id,
#                               **kwargs):
# def router_association_delete(request, resource_id, bgpvpn_id):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/forms.py
# LOG = logging.getLogger(__name__)
# class CommonData(forms.SelfHandlingForm):
# class EditDataBgpVpn(CommonData):
# class CreateNetworkAssociation(forms.SelfHandlingForm):
#     def __init__(self, request, *args, **kwargs):
#     def _del_attributes(attributes, data):
#     def handle(self, request, data):
#     def __init__(self, request, *args, **kwargs):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
#     def _set_params(self, data):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/tables.py
# class EditInfoBgpVpn(tables.LinkAction):
# class CreateNetworkAssociation(tables.LinkAction):
# class CreateRouterAssociation(tables.LinkAction):
# class NetworksColumn(tables.Column):
# class RoutersColumn(tables.Column):
# class BgpvpnTable(tables.DataTable):
#     class Meta(object):
#     def get_link_url(self, bgpvpn):
# def get_network_url(network):
# def get_router_url(router):
#     def get_raw_data(self, bgpvpn):
#     def get_raw_data(self, bgpvpn):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/views.py
# class IndexView(tables.DataTableView):
# class EditDataView(forms.ModalFormView):
# class GetBgpvpnMixin(object):
# class CreateNetworkAssociationView(GetBgpvpnMixin, forms.ModalFormView):
# class CreateRouterAssociationView(GetBgpvpnMixin, workflows.WorkflowView):
# class DetailProjectView(tabs.TabbedTableView):
#     def get_data(self):
#     def _join_rts(route_targets_list):
#     def get_context_data(self, **kwargs):
#     def get_initial(self):
#     def get_initial(self):
#     def get_context_data(self, **kwargs):
#     def get_context_data(self, **kwargs):
#     def get_data(self):


from unittest import mock
from django.urls import reverse
from django.urls import reverse_lazy
from bgpvpn_dashboard.api import bgpvpn as bgpvpn_api
from bgpvpn_dashboard.dashboards.project.bgpvpn import forms as bgpvpn_form
from bgpvpn_dashboard.dashboards.project.bgpvpn import tables as bgpvpn_tables
from bgpvpn_dashboard.dashboards.project.bgpvpn import views as bgpvpn_views
from openstack_dashboard.test import helpers
        bgpvpn_data = {"name": "foo-name",
                       "id": "foo-id",
                       "type": "l3"}
        expected_data = {"name": "foo-name",
                         "bgpvpn_id": "foo-id",
                         "type": "l3"}
        mock_bgpvpn_api.bgpvpn_get.return_value = bgpvpn_api.Bgpvpn(
            bgpvpn_data)
        result = self.bgpvpn_view.get_initial()

        mock_bgpvpn_api.bgpvpn_get.assert_called_once_with(
            self.bgpvpn_view.request, "foo-id")
        for key, val in expected_data.items():
            self.assertEqual(val, result[key])

    @mock.patch.object(bgpvpn_views, 'bgpvpn_api', autospec=True)
    def test_get_initial_admin(self, mock_bgpvpn_api):
        self.bgpvpn_view.request.user.is_superuser = True
        bgpvpn_data = {"name": "foo-name",
                       "id": "foo-id",
                       "type": "l3",
                       "route_targets": ["65432:1", "65432:2"],
                       "import_targets": [],
                       "export_targets": []}
        expected_data = {"name": "foo-name",
                         "bgpvpn_id": "foo-id",
                         "type": "l3",
                         "route_targets": "65432:1,65432:2",
                         "import_targets": "",
                         "export_targets": ""}

# Path: bgpvpn_dashboard/api/bgpvpn.py
# LOG = logging.getLogger(__name__)
# class Bgpvpn(neutron.NeutronAPIDictWrapper):
# class NetworkAssociation(neutron.NeutronAPIDictWrapper):
# class RouterAssociation(neutron.NeutronAPIDictWrapper):
# def bgpvpns_list(request, **kwargs):
# def bgpvpn_get(request, bgpvpn_id, **kwargs):
# def bgpvpn_create(request, **kwargs):
# def bgpvpn_update(request, bgpvpn_id, **kwargs):
# def bgpvpn_delete(request, bgpvpn_id):
# def network_association_get(request, bgpvpn_id, network_assoc_id, **kwargs):
# def network_association_list(request, bgpvpn_id, **kwargs):
# def network_association_create(request, bgpvpn_id, **kwargs):
# def network_association_delete(request, resource_id, bgpvpn_id):
# def router_association_get(request, bgpvpn_id, router_assoc_id, **kwargs):
# def router_association_list(request, bgpvpn_id, **kwargs):
# def router_association_create(request, bgpvpn_id, **kwargs):
# def router_association_update(request, bgpvpn_id, router_association_id,
#                               **kwargs):
# def router_association_delete(request, resource_id, bgpvpn_id):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/forms.py
# LOG = logging.getLogger(__name__)
# class CommonData(forms.SelfHandlingForm):
# class EditDataBgpVpn(CommonData):
# class CreateNetworkAssociation(forms.SelfHandlingForm):
#     def __init__(self, request, *args, **kwargs):
#     def _del_attributes(attributes, data):
#     def handle(self, request, data):
#     def __init__(self, request, *args, **kwargs):
#     def __init__(self, request, *args, **kwargs):
#     def handle(self, request, data):
#     def _set_params(self, data):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/tables.py
# class EditInfoBgpVpn(tables.LinkAction):
# class CreateNetworkAssociation(tables.LinkAction):
# class CreateRouterAssociation(tables.LinkAction):
# class NetworksColumn(tables.Column):
# class RoutersColumn(tables.Column):
# class BgpvpnTable(tables.DataTable):
#     class Meta(object):
#     def get_link_url(self, bgpvpn):
# def get_network_url(network):
# def get_router_url(router):
#     def get_raw_data(self, bgpvpn):
#     def get_raw_data(self, bgpvpn):
# 
# Path: bgpvpn_dashboard/dashboards/project/bgpvpn/views.py
# class IndexView(tables.DataTableView):
# class EditDataView(forms.ModalFormView):
# class GetBgpvpnMixin(object):
# class CreateNetworkAssociationView(GetBgpvpnMixin, forms.ModalFormView):
# class CreateRouterAssociationView(GetBgpvpnMixin, workflows.WorkflowView):
# class DetailProjectView(tabs.TabbedTableView):
#     def get_data(self):
#     def _join_rts(route_targets_list):
#     def get_context_data(self, **kwargs):
#     def get_initial(self):
#     def get_initial(self):
#     def get_context_data(self, **kwargs):
#     def get_context_data(self, **kwargs):
#     def get_data(self):


# Path: bgpvpn_dashboard/test/project/test_views.py
from unittest import mock
from django.urls import reverse
from django.urls import reverse_lazy
from bgpvpn_dashboard.api import bgpvpn as bgpvpn_api
from bgpvpn_dashboard.dashboards.project.bgpvpn import forms as bgpvpn_form
from bgpvpn_dashboard.dashboards.project.bgpvpn import tables as bgpvpn_tables
from bgpvpn_dashboard.dashboards.project.bgpvpn import views as bgpvpn_views
from openstack_dashboard.test import helpers

        bgpvpn_data = {"name": "foo-name",
                       "id": "foo-id",
                       "type": "l3"}
        expected_data = {"name": "foo-name",
                         "bgpvpn_id": "foo-id",
                         "type": "l3"}
        mock_bgpvpn_api.bgpvpn_get.return_value = bgpvpn_api.Bgpvpn(
            bgpvpn_data)
        result = self.bgpvpn_view.get_initial()

        mock_bgpvpn_api.bgpvpn_get.assert_called_once_with(
            self.bgpvpn_view.request, "foo-id")
        for key, val in expected_data.items():
            self.assertEqual(val, result[key])

    @mock.patch.object(bgpvpn_views, 'bgpvpn_api', autospec=True)
    def test_get_initial_admin(self, mock_bgpvpn_api):
        self.bgpvpn_view.request.user.is_superuser = True
        bgpvpn_data = {"name": "foo-name",
                       "id": "foo-id",
                       "type": "l3",
                       "route_targets": ["65432:1", "65432:2"],
                       "import_targets": [],
                       "export_targets": []}
        expected_data = {"name": "foo-name",
                         "bgpvpn_id": "foo-id",
                         "type": "l3",
                         "route_targets": "65432:1,65432:2",
                         "import_targets": "",
                         "export_targets": ""}

        mock_bgpvpn_api.bgpvpn_get.return_value = bgpvpn_api.Bgpvpn(