- Use URL.create
- Stop testing for undocumented (now unavailable) dict-style access to rowsmaster
parent
9fbf83baff
commit
f394d92981
|
@ -10,7 +10,7 @@ def connection_from_dsn_section(section, config):
|
|||
parser = CP.ConfigParser()
|
||||
parser.read(config.dsn_filename)
|
||||
cfg_dict = dict(parser.items(section))
|
||||
return str(URL(**cfg_dict))
|
||||
return URL.create(**cfg_dict)
|
||||
|
||||
|
||||
def _connection_string(s, config):
|
||||
|
|
|
@ -37,7 +37,7 @@ def ip():
|
|||
|
||||
def test_memory_db(ip):
|
||||
assert runsql(ip, "SELECT * FROM test;")[0][0] == 1
|
||||
assert runsql(ip, "SELECT * FROM test;")[1]["name"] == "bar"
|
||||
assert runsql(ip, "SELECT * FROM test;")[1].name == "bar"
|
||||
|
||||
|
||||
def test_html(ip):
|
||||
|
|
|
@ -110,9 +110,9 @@ class DummyConfig:
|
|||
|
||||
def test_connection_from_dsn_section():
|
||||
result = connection_from_dsn_section(section="DB_CONFIG_1", config=DummyConfig())
|
||||
assert result == "postgres://goesto11:seentheelephant@my.remote.host:5432/pgmain"
|
||||
assert str(result) == "postgres://goesto11:***@my.remote.host:5432/pgmain"
|
||||
result = connection_from_dsn_section(section="DB_CONFIG_2", config=DummyConfig())
|
||||
assert result == "mysql://thefin:fishputsfishonthetable@127.0.0.1/dolfin"
|
||||
assert str(result) == "mysql://thefin:***@127.0.0.1/dolfin"
|
||||
|
||||
|
||||
class Bunch:
|
||||
|
|
Loading…
Reference in New Issue