From a52cde8ff99196daa62963fe677fe3e1bc91d6bb Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Wed, 13 Jun 2018 14:14:09 +0800 Subject: Add test_insert_dynamic_controller Add test_insert_dynamic_controller Change-Id: I1eebe593bdd945bfd2b7ecf386960d1cab7e98c0 Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn --- vio/vio/tests/test_apiv2_controller.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vio/vio/tests/test_apiv2_controller.py b/vio/vio/tests/test_apiv2_controller.py index e48f321..d48b769 100644 --- a/vio/vio/tests/test_apiv2_controller.py +++ b/vio/vio/tests/test_apiv2_controller.py @@ -17,6 +17,7 @@ from keystoneauth1.identity import v2 as keystone_v2 from keystoneauth1.identity import v3 as keystone_v3 from vio.api_v2.api_router import controller_builder as cb +from vio.api_v2.api_router import v0_controller from vio.pub.msapi import extsys @@ -59,3 +60,12 @@ class TestAPIv2Controller(unittest.TestCase): self.assertEqual(False, cb._property_exists(res, "dd", required=False)) self.assertRaises( Exception, cb._property_exists, res, "dd", required=True) + + def test_insert_dynamic_controller(self): + controller = v0_controller.V0_Controller() + cb.insert_dynamic_controller(controller) + self.assertEqual(True, hasattr(controller, "hosts")) + self.assertEqual(True, hasattr(controller, "images")) + self.assertEqual(True, hasattr(controller, "ports")) + self.assertEqual(True, hasattr(controller, "networks")) + self.assertEqual(True, hasattr(controller, "subnets")) -- cgit 1.2.3-korg