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

Method test_direct_tls_native

tests/test_connect.py:2445–2457  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2443 self.assertFalse(ctx.check_hostname)
2444
2445 async def test_direct_tls_native(self):
2446 if self.cluster.get_pg_version() < (17, 0):
2447 self.skipTest('native direct TLS requires PostgreSQL 17+')
2448
2449 for mode in ('require', 'verify-ca', 'verify-full', True):
2450 with self.subTest(mode=mode):
2451 with unittest.mock.patch.dict(os.environ, {
2452 'SSL_CERT_FILE': SSL_CA_CERT_FILE,
2453 }):
2454 await self._test_works(
2455 dsn='postgresql://ssl_user@localhost/postgres'
2456 '?sslrootcert=' + SSL_CA_CERT_FILE,
2457 ssl=mode, direct_tls=True, expected_ssl=True)
2458
2459 async def test_direct_tls_configuration_sources(self):
2460 base_dsn = 'postgresql://ssl_user@localhost/postgres'

Callers

nothing calls this directly

Calls 2

get_pg_versionMethod · 0.80
_test_worksMethod · 0.80

Tested by

no test coverage detected