From 4a843ddbb409e371294c8ac61334ac0a7ecd5c8d Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Fri, 14 Sep 2018 15:10:52 -0600 Subject: [PATCH] Test for missing database configuration message The review of Iecf5006b32ca7bc2d46b7a59e78b4941a2e98122 identified that the test for a missing [placement_database]/connection was not checking that the exception raised was for the expected missing config. Now it does. Change-Id: If2f0ed3af762a39deaba9ec73e6c1aa8cac9f364 --- placement/tests/unit/test_db_conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/placement/tests/unit/test_db_conf.py b/placement/tests/unit/test_db_conf.py index 357c28f2b..162f63dae 100644 --- a/placement/tests/unit/test_db_conf.py +++ b/placement/tests/unit/test_db_conf.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import six import testtools from oslo_config import cfg @@ -27,6 +28,10 @@ class TestPlacementDBConf(testtools.TestCase): self.conf_fixture = self.useFixture(config_fixture.Config(CONF)) def test_missing_config_raises(self): - self.assertRaises( + """Not setting [placement_database]/connection is an error.""" + exc = self.assertRaises( cfg.RequiredOptError, self.conf_fixture.conf, [], default_config_files=[]) + self.assertIn( + 'option connection in group [placement_database]', + six.text_type(exc))