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")
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")
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"})
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"})
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"})