MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / verify_works

Method verify_works

tests/test_connect.py:1884–1895  ·  view source on GitHub ↗
(sslmode, *, host='localhost')

Source from the content-addressed store, hash-verified

1882
1883 async def test_ssl_connection_sslmode(self):
1884 async def verify_works(sslmode, *, host='localhost'):
1885 con = None
1886 try:
1887 con = await self.connect(
1888 dsn='postgresql://foo/postgres?sslmode=' + sslmode,
1889 host=host,
1890 user='ssl_user')
1891 self.assertEqual(await con.fetchval('SELECT 42'), 42)
1892 self.assertTrue(con._protocol.is_ssl)
1893 finally:
1894 if con:
1895 await con.close()
1896
1897 async def verify_fails(sslmode, *, host='localhost', exn_type):
1898 # XXX: uvloop artifact

Callers

nothing calls this directly

Calls 3

connectMethod · 0.45
fetchvalMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected