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 | |
| parent | b50da3dbd7e98dfe5360684a55b342666c7683ca (diff) | |
tests/extmod: Add test for passing cadata into ssl.wrap_socket().
For coverage.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | tests/extmod/ssl_cadata.py | 14 | ||||
| -rw-r--r-- | tests/extmod/ssl_cadata.py.exp | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/extmod/ssl_cadata.py b/tests/extmod/ssl_cadata.py new file mode 100644 index 000000000..a68cae1ec --- /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)) diff --git a/tests/extmod/ssl_cadata.py.exp b/tests/extmod/ssl_cadata.py.exp new file mode 100644 index 000000000..9f1cf732e --- /dev/null +++ b/tests/extmod/ssl_cadata.py.exp @@ -0,0 +1 @@ +ValueError('invalid cert',) |
