# 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):


from unittest import mock
from django import test
from django.utils.translation import ugettext_lazy as _
from bgpvpn_dashboard.dashboards.project.bgpvpn import tables as bgpvpn_tables





class TestFunctionGet(test.TestCase):

    @mock.patch.object(bgpvpn_tables, 'reverse')
    def test_get_network_url(self, mock_reverse):
        mock_reverse.return_value = 'foo_reverse_url'
        mock_network = mock.Mock(id='foo-id', name_or_id="foo")
        result = bgpvpn_tables.get_network_url(mock_network)
        mock_reverse.assert_called_once_with(
            'horizon:project:networks:detail', args=['foo-id'])
        self.assertEqual('<a href=foo_reverse_url>foo</a>', result)

    @mock.patch.object(bgpvpn_tables, 'reverse')
    def test_get_router_url(self, mock_reverse):
        mock_reverse.return_value = 'foo_reverse_url'
        mock_network = mock.Mock(id='foo-id', name_or_id="foo")
        result = bgpvpn_tables.get_router_url(mock_network)
        mock_reverse.assert_called_once_with(
            'horizon:project:routers:detail', args=['foo-id'])
        self.assertEqual('<a href=foo_reverse_url>foo</a>', result)


class TestNetworksColumn(test.TestCase):

    def setUp(self):
        super(TestNetworksColumn, self).setUp()

# 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/test/project/test_tables.py
from unittest import mock
from django import test
from django.utils.translation import ugettext_lazy as _
from bgpvpn_dashboard.dashboards.project.bgpvpn import tables as bgpvpn_tables






class TestFunctionGet(test.TestCase):

    @mock.patch.object(bgpvpn_tables, 'reverse')
    def test_get_network_url(self, mock_reverse):
        mock_reverse.return_value = 'foo_reverse_url'
        mock_network = mock.Mock(id='foo-id', name_or_id="foo")
        result = bgpvpn_tables.get_network_url(mock_network)
        mock_reverse.assert_called_once_with(
            'horizon:project:networks:detail', args=['foo-id'])
        self.assertEqual('<a href=foo_reverse_url>foo</a>', result)

    @mock.patch.object(bgpvpn_tables, 'reverse')
    def test_get_router_url(self, mock_reverse):
        mock_reverse.return_value = 'foo_reverse_url'
        mock_network = mock.Mock(id='foo-id', name_or_id="foo")
        result = bgpvpn_tables.get_router_url(mock_network)
        mock_reverse.assert_called_once_with(
            'horizon:project:routers:detail', args=['foo-id'])
        self.assertEqual('<a href=foo_reverse_url>foo</a>', result)


class TestNetworksColumn(test.TestCase):

    def setUp(self):
        super(TestNetworksColumn, self).setUp()

        self.nets_column = bgpvpn_tables.NetworksColumn(