MCPcopy
hub / github.com/psycopg/psycopg / test_conninfo_parse

Function test_conninfo_parse

tests/pq/test_conninfo.py:21–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20@pytest.mark.libpq(">= 10")
21def test_conninfo_parse():
22 infos = pq.Conninfo.parse(
23 b"postgresql://host1:123,host2:456/somedb"
24 b"?target_session_attrs=any&application_name=myapp"
25 )
26 info = {i.keyword: i.val for i in infos if i.val is not None}
27 assert info[b"host"] == b"host1,host2"
28 assert info[b"port"] == b"123,456"
29 assert info[b"dbname"] == b"somedb"
30 assert info[b"application_name"] == b"myapp"
31
32
33@pytest.mark.libpq("< 10")

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected