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

Method verify_works

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

Source from the content-addressed store, hash-verified

1832 @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster')
1833 async def test_connection_sslmode_no_ssl_server(self):
1834 async def verify_works(sslmode):
1835 con = None
1836 try:
1837 con = await self.connect(
1838 dsn='postgresql://foo/?sslmode=' + sslmode,
1839 user='postgres',
1840 database='postgres',
1841 host='localhost')
1842 self.assertEqual(await con.fetchval('SELECT 42'), 42)
1843 self.assertFalse(con._protocol.is_ssl)
1844 finally:
1845 if con:
1846 await con.close()
1847
1848 async def verify_fails(sslmode):
1849 con = None

Callers

nothing calls this directly

Calls 3

connectMethod · 0.45
fetchvalMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected