diff options
author | Damien George <damien@micropython.org> | 2023-06-25 15:28:09 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-06-26 16:34:41 +1000 |
commit | 9900eaa2698ef493d15237cb737bdfcc51ac193f (patch) | |
tree | 26cf04ef896158ac8c9bada4f559cc047eaa2047 /tests/extmod/ssl_cadata.py | |
parent | b50da3dbd7e98dfe5360684a55b342666c7683ca (diff) | |
download | micropython-9900eaa2698ef493d15237cb737bdfcc51ac193f.tar.gz micropython-9900eaa2698ef493d15237cb737bdfcc51ac193f.zip |
tests/extmod: Add test for passing cadata into ssl.wrap_socket().
For coverage.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/ssl_cadata.py')
-rw-r--r-- | tests/extmod/ssl_cadata.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/extmod/ssl_cadata.py b/tests/extmod/ssl_cadata.py new file mode 100644 index 0000000000..a68cae1ecb --- /dev/null +++ b/tests/extmod/ssl_cadata.py @@ -0,0 +1,14 @@ +# Test ssl.wrap_socket() with cadata passed in. + +try: + import io + import ssl +except ImportError: + print("SKIP") + raise SystemExit + +# Invalid cadata. +try: + ssl.wrap_socket(io.BytesIO(), cadata=b"!") +except ValueError as er: + print(repr(er)) |