summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_dialect.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-09-30 12:07:25 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-09-30 12:07:25 +0000
commitb21a03316ff35ea86405f07d70fa1a2de7a01378 (patch)
tree880ee3bd416d8f69a69b36ba92b943ec8e2324a9 /test/dialect/postgresql/test_dialect.py
parentf483573aa640efb79e8b1ec6c1faac6f79d9d8fe (diff)
parentf9ef7fd30b3f0613bc9dd912621856b3262d23bc (diff)
downloadsqlalchemy-b21a03316ff35ea86405f07d70fa1a2de7a01378.tar.gz
Merge "Support for multiple hosts in PostgreSQL connection string"
Diffstat (limited to 'test/dialect/postgresql/test_dialect.py')
-rw-r--r--test/dialect/postgresql/test_dialect.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index 43c5aea21..8ee5a6e2f 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -159,6 +159,25 @@ class DialectTest(fixtures.TestBase):
eq_(cargs, [])
eq_(cparams, {"host": "somehost", "any_random_thing": "yes"})
+ def test_psycopg2_nonempty_connection_string_w_query_two(self):
+ dialect = psycopg2_dialect.dialect()
+ url_string = "postgresql://USER:PASS@/DB?host=hostA"
+ u = url.make_url(url_string)
+ cargs, cparams = dialect.create_connect_args(u)
+ eq_(cargs, [])
+ eq_(cparams["host"], "hostA")
+
+ def test_psycopg2_nonempty_connection_string_w_query_three(self):
+ dialect = psycopg2_dialect.dialect()
+ url_string = (
+ "postgresql://USER:PASS@/DB"
+ "?host=hostA:portA&host=hostB&host=hostC"
+ )
+ u = url.make_url(url_string)
+ cargs, cparams = dialect.create_connect_args(u)
+ eq_(cargs, [])
+ eq_(cparams["host"], "hostA:portA,hostB,hostC")
+
class ExecuteManyMode(object):
__only_on__ = "postgresql+psycopg2"