summaryrefslogtreecommitdiff
path: root/OpenSSL/test
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@divmod.com>2011-05-26 19:24:02 -0400
committerJean-Paul Calderone <exarkun@divmod.com>2011-05-26 19:24:02 -0400
commit871a4d81052e6b6a942f0a66213ed04f8a6054e5 (patch)
tree1b25b47248478198f0bf37f02d3470af507c91ea /OpenSSL/test
parentc4cb658c516e20cad3e8707ba66dab78ce0bd1e8 (diff)
downloadpyopenssl-871a4d81052e6b6a942f0a66213ed04f8a6054e5.tar.gz
"Parse" "arguments" to get_servername
Diffstat (limited to 'OpenSSL/test')
-rw-r--r--OpenSSL/test/test_ssl.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index 52ff818..2ab67fd 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -1080,6 +1080,17 @@ class ConnectionTests(TestCase, _LoopbackMixin):
conn.set_tlsext_host_name, b("example.com").decode("ascii"))
+ def test_get_servername_wrong_args(self):
+ """
+ L{Connection.get_servername} raises L{TypeError} if called with any
+ arguments.
+ """
+ connection = Connection(Context(TLSv1_METHOD), None)
+ self.assertRaises(TypeError, connection.get_servername, object())
+ self.assertRaises(TypeError, connection.get_servername, 1)
+ self.assertRaises(TypeError, connection.get_servername, "hello")
+
+
def test_pending(self):
"""
L{Connection.pending} returns the number of bytes available for