tests/extmod: Add test for passing cadata into ssl.wrap_socket().

For coverage.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2023-06-25 15:28:09 +10:00
parent b50da3dbd7
commit 9900eaa269
2 changed files with 15 additions and 0 deletions

View File

@ -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))

View File

@ -0,0 +1 @@
ValueError('invalid cert',)