(sslmode, *, host='localhost')
| 2162 | |
| 2163 | async def test_nossl_connection_sslmode(self): |
| 2164 | async def verify_works(sslmode, *, host='localhost'): |
| 2165 | con = None |
| 2166 | try: |
| 2167 | con = await self.connect( |
| 2168 | dsn='postgresql://foo/postgres?sslmode=' + sslmode, |
| 2169 | host=host, |
| 2170 | user='ssl_user') |
| 2171 | self.assertEqual(await con.fetchval('SELECT 42'), 42) |
| 2172 | self.assertFalse(con._protocol.is_ssl) |
| 2173 | finally: |
| 2174 | if con: |
| 2175 | await con.close() |
| 2176 | |
| 2177 | async def verify_fails(sslmode, *, host='localhost'): |
| 2178 | # XXX: uvloop artifact |