diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-12-10 16:54:14 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-12-10 16:54:14 +0000 |
commit | ed200283c17f5502a06b9081c1968c700219384a (patch) | |
tree | 9ddd52fc51ec4fac420171284dd93563c326067b | |
parent | b60b3fe7bfc9f8a5846c4a51cb503c732ca1e29b (diff) | |
parent | 4c939b38eb1328094e4b73eec0955ba7c2f2e67d (diff) | |
download | oslo-db-ed200283c17f5502a06b9081c1968c700219384a.tar.gz |
Merge "Fix TestConnectionUtils to py3x compatibility"
-rw-r--r-- | tests/sqlalchemy/test_utils.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/sqlalchemy/test_utils.py b/tests/sqlalchemy/test_utils.py index c13fe9d..78fef85 100644 --- a/tests/sqlalchemy/test_utils.py +++ b/tests/sqlalchemy/test_utils.py @@ -512,12 +512,12 @@ class TestConnectionUtils(test_utils.BaseTestCase): def setUp(self): super(TestConnectionUtils, self).setUp() - self.full_credentials = {'backend': 'mysql', + self.full_credentials = {'backend': 'postgresql', 'database': 'test', 'user': 'dude', 'passwd': 'pass'} - self.connect_string = 'mysql://dude:pass@localhost/test' + self.connect_string = 'postgresql://dude:pass@localhost/test' def test_connect_string(self): connect_string = utils.get_connect_string(**self.full_credentials) @@ -540,7 +540,7 @@ class TestConnectionUtils(test_utils.BaseTestCase): def test_is_backend_unavail(self): log = self.useFixture(fixtures.FakeLogger()) err = OperationalError("Can't connect to database", None, None) - error_msg = "The mysql backend is unavailable: %s\n" % err + error_msg = "The postgresql backend is unavailable: %s\n" % err self.mox.StubOutWithMock(sqlalchemy.engine.base.Engine, 'connect') sqlalchemy.engine.base.Engine.connect().AndRaise(err) self.mox.ReplayAll() @@ -571,7 +571,7 @@ class TestConnectionUtils(test_utils.BaseTestCase): ) self.assertEqual("Could not connect", str(exc)) self.assertEqual( - "The mysql backend is unavailable: %s" % err, + "The postgresql backend is unavailable: %s" % err, log.output.strip()) def test_ensure_backend_available_no_dbapi_raises(self): @@ -588,7 +588,7 @@ class TestConnectionUtils(test_utils.BaseTestCase): ) self.assertEqual("No DBAPI installed", str(exc)) self.assertEqual( - "The mysql backend is unavailable: Can't import " + "The postgresql backend is unavailable: Can't import " "DBAPI module foobar", log.output.strip()) def test_get_db_connection_info(self): @@ -599,7 +599,7 @@ class TestConnectionUtils(test_utils.BaseTestCase): def test_connect_string_host(self): self.full_credentials['host'] = 'myhost' connect_string = utils.get_connect_string(**self.full_credentials) - self.assertEqual(connect_string, 'mysql://dude:pass@myhost/test') + self.assertEqual(connect_string, 'postgresql://dude:pass@myhost/test') class MyModelSoftDeletedProjectId(declarative_base(), models.ModelBase, |