MCPcopy Index your code
hub / github.com/dbcli/pgcli / test_ssl_db_uri

Function test_ssl_db_uri

tests/test_main.py:507–522  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

505
506
507def test_ssl_db_uri(tmpdir):
508 with mock.patch.object(PGCli, "connect") as mock_connect:
509 cli = PGCli(pgclirc_file=str(tmpdir.join("rcfile")))
510 cli.connect_uri(
511 "postgres://bar%5E:%5Dfoo@baz.com/testdb%5B?sslmode=verify-full&sslcert=m%79.pem&sslkey=my-key.pem&sslrootcert=c%61.pem"
512 )
513 mock_connect.assert_called_with(
514 database="testdb[",
515 host="baz.com",
516 user="bar^",
517 passwd="]foo",
518 sslmode="verify-full",
519 sslcert="my.pem",
520 sslkey="my-key.pem",
521 sslrootcert="ca.pem",
522 )
523
524
525def test_port_db_uri(tmpdir):

Callers

nothing calls this directly

Calls 2

connect_uriMethod · 0.95
PGCliClass · 0.90

Tested by

no test coverage detected