]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Pythonic method names for l3_agent unit tests
authorZhiQiang Fan <aji.zqfan@gmail.com>
Thu, 26 Sep 2013 16:10:50 +0000 (00:10 +0800)
committerZhiQiang Fan <aji.zqfan@gmail.com>
Thu, 26 Sep 2013 16:10:50 +0000 (00:10 +0800)
When review https://review.openstack.org/#/c/46863/, i find there
are some unconsistent method names in test_l3_agent.py, this patch
fixes this code style problem.

Change-Id: I0e657e02155e1fcd580f083f4b5ba56274eadf88
Partial-Bug: #1229155

neutron/tests/unit/test_l3_agent.py

index e4057d3541a14e9768691b4c0b3772fb072a2125..1c88d60227d5990f6338fa633e2a1cbf23c2b61a 100644 (file)
@@ -83,7 +83,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
 
         self.addCleanup(mock.patch.stopall)
 
-    def testRouterInfoCreate(self):
+    def test_router_info_create(self):
         id = _uuid()
         ri = l3_agent.RouterInfo(id, self.conf.root_helper,
                                  self.conf.use_namespaces, None)
@@ -108,7 +108,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
         self.assertTrue(ri.ns_name().endswith(id))
         self.assertEqual(ri.router, router)
 
-    def testAgentCreate(self):
+    def test_agent_create(self):
         l3_agent.L3NATAgent(HOSTNAME, self.conf)
 
     def _test_internal_network_action(self, action):
@@ -134,10 +134,10 @@ class TestBasicRouterOperations(base.BaseTestCase):
         else:
             raise Exception("Invalid action %s" % action)
 
-    def testAgentAddInternalNetwork(self):
+    def test_agent_add_internal_network(self):
         self._test_internal_network_action('add')
 
-    def testAgentRemoveInternalNetwork(self):
+    def test_agent_remove_internal_network(self):
         self._test_internal_network_action('remove')
 
     def _test_external_gateway_action(self, action):
@@ -180,10 +180,10 @@ class TestBasicRouterOperations(base.BaseTestCase):
         else:
             raise Exception("Invalid action %s" % action)
 
-    def testAgentAddExternalGateway(self):
+    def test_agent_add_external_gateway(self):
         self._test_external_gateway_action('add')
 
-    def testAgentRemoveExternalGateway(self):
+    def test_agent_remove_external_gateway(self):
         self._test_external_gateway_action('remove')
 
     def _test_floating_ip_action(self, action):
@@ -221,10 +221,10 @@ class TestBasicRouterOperations(base.BaseTestCase):
         else:
             raise Exception("Invalid action %s" % action)
 
-    def testAgentAddFloatingIP(self):
+    def test_agent_add_floating_ip(self):
         self._test_floating_ip_action('add')
 
-    def testAgentRemoveFloatingIP(self):
+    def test_agent_remove_floating_ip(self):
         self._test_floating_ip_action('remove')
 
     def _check_agent_method_called(self, agent, calls, namespace):
@@ -273,16 +273,16 @@ class TestBasicRouterOperations(base.BaseTestCase):
                      'via', '1.2.3.4']]
         self._check_agent_method_called(agent, expected, namespace)
 
-    def testAgentRoutingTableUpdated(self):
+    def test_agent_routing_table_updated(self):
         self._test_routing_table_update(namespace=True)
 
-    def testAgentRoutingTableUpdatedNoNameSpace(self):
+    def test_agent_routing_table_updated_no_namespace(self):
         self._test_routing_table_update(namespace=False)
 
-    def testRoutesUpdated(self):
+    def test_routes_updated(self):
         self._test_routes_updated(namespace=True)
 
-    def testRoutesUpdatedNoNamespace(self):
+    def test_routes_updated_no_namespace(self):
         self._test_routes_updated(namespace=False)
 
     def _test_routes_updated(self, namespace=True):
@@ -380,7 +380,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
             router['enable_snat'] = enable_snat
         return router
 
-    def testProcessRouter(self):
+    def test_process_router(self):
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
         router = self._prepare_router_data()
         fake_floatingips1 = {'floatingips': [
@@ -513,7 +513,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
                 self.assertEqual(kwargs, {})
                 break
 
-    def testRoutersWithAdminStateDown(self):
+    def test_routers_with_admin_state_down(self):
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
         self.plugin_api.get_external_network_id.return_value = None
 
@@ -566,7 +566,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
         agent._process_router_delete()
         self.assertFalse(list(agent.removed_routers))
 
-    def testDestroyNamespace(self):
+    def test_destroy_namespace(self):
 
         class FakeDev(object):
             def __init__(self, name):
@@ -584,7 +584,7 @@ class TestBasicRouterOperations(base.BaseTestCase):
 
         self.assertEqual(agent._destroy_router_namespace.call_count, 2)
 
-    def testDestroyNamespaceWithRouterId(self):
+    def test_destroy_namespace_with_router_id(self):
 
         class FakeDev(object):
             def __init__(self, name):