From 85db592d43c82e352e64121a435720bf4a4a1450 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 12 Jun 2014 01:35:10 -0700 Subject: [PATCH] Big Switch: Import DB module in unit test Import the portbinding db module in the Big Switch base test case so the table gets created before the test is run. Otherwise the tests will fail when being run with testtools because the portbinding db isn't normally imported until a function call from the Plugin. Closes-Bug: #1331240 Change-Id: Icbd2248a0c013c142ccf9b302a1ffa15c5a4e5ae --- neutron/tests/unit/bigswitch/test_base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neutron/tests/unit/bigswitch/test_base.py b/neutron/tests/unit/bigswitch/test_base.py index 53be0931e..6e5a0f7fe 100644 --- a/neutron/tests/unit/bigswitch/test_base.py +++ b/neutron/tests/unit/bigswitch/test_base.py @@ -25,6 +25,12 @@ from neutron.db import api as db from neutron.plugins.bigswitch import config from neutron.tests.unit.bigswitch import fake_server +# REVISIT(kevinbenton): This needs to be imported here to create the +# portbindings table since it's not imported until function call time +# in the porttracker_db module, which will cause unit test failures when +# the unit tests are being run by testtools +from neutron.db import portbindings_db # noqa + RESTPROXY_PKG_PATH = 'neutron.plugins.bigswitch.plugin' NOTIFIER = 'neutron.plugins.bigswitch.plugin.AgentNotifierApi' CALLBACKS = 'neutron.plugins.bigswitch.plugin.RestProxyCallbacks' -- 2.45.2