aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pyOpenSSL/py3/tests/test_util.py
diff options
context:
space:
mode:
authormaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/pyOpenSSL/py3/tests/test_util.py
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
downloadydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/pyOpenSSL/py3/tests/test_util.py')
-rw-r--r--contrib/python/pyOpenSSL/py3/tests/test_util.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/python/pyOpenSSL/py3/tests/test_util.py b/contrib/python/pyOpenSSL/py3/tests/test_util.py
new file mode 100644
index 0000000000..6224448d43
--- /dev/null
+++ b/contrib/python/pyOpenSSL/py3/tests/test_util.py
@@ -0,0 +1,19 @@
+import pytest
+
+from OpenSSL._util import exception_from_error_queue, lib
+
+
+class TestErrors(object):
+ """
+ Tests for handling of certain OpenSSL error cases.
+ """
+
+ def test_exception_from_error_queue_nonexistent_reason(self):
+ """
+ :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)
+ with pytest.raises(ValueError) as exc:
+ exception_from_error_queue(ValueError)
+ assert exc.value.args[0][0][2] == ""