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