summaryrefslogtreecommitdiffstats
path: root/snaps/domain/test/network_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'snaps/domain/test/network_tests.py')
-rw-r--r--snaps/domain/test/network_tests.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/snaps/domain/test/network_tests.py b/snaps/domain/test/network_tests.py
index 24a60c9..3e449b4 100644
--- a/snaps/domain/test/network_tests.py
+++ b/snaps/domain/test/network_tests.py
@@ -213,7 +213,8 @@ class RouterDomainObjectTests(unittest.TestCase):
self.assertEqual('hello', router.status)
self.assertEqual('1234', router.tenant_id)
self.assertEqual('yes', router.admin_state_up)
- self.assertEqual('no', router.external_gateway_info)
+ self.assertIsNone(router.external_fixed_ips)
+ self.assertIsNone(router.external_network_id)
def test_construction_named(self):
router = Router(
@@ -224,7 +225,38 @@ class RouterDomainObjectTests(unittest.TestCase):
self.assertEqual('hello', router.status)
self.assertEqual('1234', router.tenant_id)
self.assertEqual('yes', router.admin_state_up)
- self.assertEqual('no', router.external_gateway_info)
+ self.assertIsNone(router.external_fixed_ips)
+ self.assertIsNone(router.external_network_id)
+
+ def test_ext_gateway_named(self):
+ ext_gateway = {'network_id': '123',
+ 'external_fixed_ips': ['456', '789']}
+ router = Router(
+ external_fixed_ips=['456', '789'], external_network_id='123',
+ admin_state_up='yes', tenant_id='1234', status='hello', id='id',
+ name='name')
+ self.assertEqual('name', router.name)
+ self.assertEqual('id', router.id)
+ self.assertEqual('hello', router.status)
+ self.assertEqual('1234', router.tenant_id)
+ self.assertEqual('yes', router.admin_state_up)
+ self.assertEqual(['456', '789'], router.external_fixed_ips)
+ self.assertEqual('123', router.external_network_id)
+
+
+ def test_ext_net_ips_named(self):
+ ext_gateway = {'network_id': '123',
+ 'external_fixed_ips': ['456', '789']}
+ router = Router(
+ external_gateway_info=ext_gateway, admin_state_up='yes',
+ tenant_id='1234', status='hello', id='id', name='name')
+ self.assertEqual('name', router.name)
+ self.assertEqual('id', router.id)
+ self.assertEqual('hello', router.status)
+ self.assertEqual('1234', router.tenant_id)
+ self.assertEqual('yes', router.admin_state_up)
+ self.assertEqual(['456', '789'], router.external_fixed_ips)
+ self.assertEqual('123', router.external_network_id)
class InterfaceRouterDomainObjectTests(unittest.TestCase):