]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Big Switch: Import DB module in unit test
authorKevin Benton <blak111@gmail.com>
Thu, 12 Jun 2014 08:35:10 +0000 (01:35 -0700)
committerKevin Benton <blak111@gmail.com>
Thu, 12 Jun 2014 08:43:45 +0000 (01:43 -0700)
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

index 53be0931e85af7a13682417c36b8de15d2a9e23a..6e5a0f7fe781929bb4aced0a3b36ef315117626f 100644 (file)
@@ -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'