From 5d86cfd98437eaa2b84b07ba19d51d50d64bc53f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 12 May 2015 14:07:48 +0200 Subject: Missing optional lib --- lib/Python/Lib/OpenSSL/test/test_util.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/Python/Lib/OpenSSL/test/test_util.py (limited to 'lib/Python/Lib/OpenSSL/test/test_util.py') diff --git a/lib/Python/Lib/OpenSSL/test/test_util.py b/lib/Python/Lib/OpenSSL/test/test_util.py new file mode 100644 index 000000000..8d92a3c75 --- /dev/null +++ b/lib/Python/Lib/OpenSSL/test/test_util.py @@ -0,0 +1,17 @@ +from OpenSSL._util import exception_from_error_queue, lib +from OpenSSL.test.util import TestCase + + + +class ErrorTests(TestCase): + """ + Tests for handling of certain OpenSSL error cases. + """ + def test_exception_from_error_queue_nonexistent_reason(self): + """ + :py:func:`exception_from_error_queue` raises ``ValueError`` when it + encounters an OpenSSL error code which does not have a reason string. + """ + lib.ERR_put_error(lib.ERR_LIB_EVP, 0, 1112, b"", 10) + exc = self.assertRaises(ValueError, exception_from_error_queue, ValueError) + self.assertEqual(exc.args[0][0][2], "") -- cgit v1.2.3