(self)
| 2253 | self.assertEqual(seen, [mode == 'prefer']) |
| 2254 | |
| 2255 | async def test_ssl_fallback_error_cause(self): |
| 2256 | for mode in ('allow', 'prefer'): |
| 2257 | faults = ( |
| 2258 | {'error': asyncpg.InvalidCatalogNameError}, |
| 2259 | {'error': asyncpg.TooManyConnectionsError}, |
| 2260 | ) |
| 2261 | async with self.connection_proxy(*faults) as (port, seen): |
| 2262 | with self.assertRaises(asyncpg.TooManyConnectionsError) as exc: |
| 2263 | await self.connect(host='127.0.0.1', port=port, |
| 2264 | user='ssl_user', ssl=mode) |
| 2265 | self.assertIsInstance(exc.exception.__cause__, |
| 2266 | asyncpg.InvalidCatalogNameError) |
| 2267 | self.assertEqual(seen, [mode == 'prefer', mode == 'allow']) |
| 2268 | |
| 2269 | async def test_ssl_cannot_connect_now_failover(self): |
| 2270 | self._allow_plaintext() |
nothing calls this directly
no test coverage detected