summaryrefslogtreecommitdiff
path: root/tests/test_connection.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-10-13 03:09:39 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-10-13 03:09:39 +0100
commit704e6797e7dd4ac0046caa3230a8faa1f247859f (patch)
tree76339016ed90ba5d4f1b4a1f62dfb9f98b01a36e /tests/test_connection.py
parentd138e42ee5ac39797ae6b563ddd87eca3166b458 (diff)
downloadpsycopg2-704e6797e7dd4ac0046caa3230a8faa1f247859f.tar.gz
Guard from some info functions not available in some libpq versions
Diffstat (limited to 'tests/test_connection.py')
-rwxr-xr-xtests/test_connection.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_connection.py b/tests/test_connection.py
index 0b68389..cb70bb0 100755
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -1803,10 +1803,21 @@ class TestConnectionInfo(ConnectingTestCase):
self.assertIsInstance(self.conn.info.used_password, bool)
self.assertIs(self.bconn.info.used_password, False)
+ @skip_before_libpq(9, 5)
def test_ssl_in_use(self):
self.assertIsInstance(self.conn.info.ssl_in_use, bool)
self.assertIs(self.bconn.info.ssl_in_use, False)
+ @skip_after_libpq(9, 5)
+ def test_ssl_not_supported(self):
+ with self.assertRaises(psycopg2.NotSupportedError):
+ self.conn.info.ssl_in_use
+ with self.assertRaises(psycopg2.NotSupportedError):
+ self.conn.info.ssl_attribute_names
+ with self.assertRaises(psycopg2.NotSupportedError):
+ self.conn.info.ssl_attribute('wat')
+
+ @skip_before_libpq(9, 5)
def test_ssl_attribute(self):
attribs = self.conn.info.ssl_attribute_names
self.assert_(attribs)