| 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 |