summaryrefslogtreecommitdiff
path: root/tests/sqlalchemy/test_utils.py
diff options
context:
space:
mode:
authorVlad Okhrimenko <vokhrimenko@mirantis.com>2014-07-14 13:00:24 +0300
committerVlad Okhrimenko <vokhrimenko@mirantis.com>2014-07-21 13:25:21 +0300
commitb69899e1ba519c3a5dc2db2e1c04d1eb50519114 (patch)
treef1877e6a2b3033d9b4894be51574a037a589ff63 /tests/sqlalchemy/test_utils.py
parentbf4eff9ffd577c519846c98251942a3d998311e5 (diff)
downloadoslo-db-b69899e1ba519c3a5dc2db2e1c04d1eb50519114.tar.gz
Add host argument to get_connect_string()
'localhost' value used to be hardcoded in get_connect_string(). Now it's possible to pass a custom host name as a function argument. Wrote test for this Change-Id: I3ae9f1a7df0bb378da1210cd89eef3e5f203cf34
Diffstat (limited to 'tests/sqlalchemy/test_utils.py')
-rw-r--r--tests/sqlalchemy/test_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/sqlalchemy/test_utils.py b/tests/sqlalchemy/test_utils.py
index 431fdb3..231d106 100644
--- a/tests/sqlalchemy/test_utils.py
+++ b/tests/sqlalchemy/test_utils.py
@@ -685,6 +685,11 @@ class TestConnectionUtils(test_utils.BaseTestCase):
self.assertEqual(utils.get_db_connection_info(conn_pieces),
('dude', 'pass', 'test', 'localhost'))
+ 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')
+
class MyModelSoftDeletedProjectId(declarative_base(), models.ModelBase,
models.SoftDeleteMixin):