()
| 19 | |
| 20 | @pytest.mark.libpq(">= 10") |
| 21 | def 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") |