示例#1
0
 def test_psycopg2_nonempty_connection_string_w_query_two(self):
     dialect = psycopg2_dialect.dialect()
     url_string = "postgresql://*****:*****@/DB?host=hostA"
     u = url.make_url(url_string)
     cargs, cparams = dialect.create_connect_args(u)
     eq_(cargs, [])
     eq_(cparams["host"], "hostA")
示例#2
0
 def test_psycopg2_nonempty_connection_string_w_query_three(self):
     dialect = psycopg2_dialect.dialect()
     url_string = (
         "postgresql://*****:*****@/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")
示例#3
0
 def test_psycopg2_empty_connection_string_w_query_one(self):
     dialect = psycopg2_dialect.dialect()
     u = url.make_url("postgresql:///?service=swh-log")
     cargs, cparams = dialect.create_connect_args(u)
     eq_(cargs, [])
     eq_(cparams, {"service": "swh-log"})
示例#4
0
 def test_psycopg2_nonempty_connection_string_w_query(self):
     dialect = psycopg2_dialect.dialect()
     u = url.make_url("postgresql://somehost/?any_random_thing=yes")
     cargs, cparams = dialect.create_connect_args(u)
     eq_(cargs, [])
     eq_(cparams, {"host": "somehost", "any_random_thing": "yes"})
示例#5
0
 def test_psycopg2_nonempty_connection_string(self):
     dialect = psycopg2_dialect.dialect()
     u = url.make_url("postgresql://host")
     cargs, cparams = dialect.create_connect_args(u)
     eq_(cargs, [])
     eq_(cparams, {"host": "host"})