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

Method verify_works

tests/test_connect.py:1710–1722  ·  view source on GitHub ↗
(sslmode)

Source from the content-addressed store, hash-verified

1708 @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster')
1709 async def test_connection_sslmode_no_ssl_server(self):
1710 async def verify_works(sslmode):
1711 con = None
1712 try:
1713 con = await self.connect(
1714 dsn='postgresql://foo/?sslmode=' + sslmode,
1715 user='postgres',
1716 database='postgres',
1717 host='localhost')
1718 self.assertEqual(await con.fetchval('SELECT 42'), 42)
1719 self.assertFalse(con._protocol.is_ssl)
1720 finally:
1721 if con:
1722 await con.close()
1723
1724 async def verify_fails(sslmode):
1725 con = None

Callers

nothing calls this directly

Calls 3

connectMethod · 0.45
fetchvalMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected