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:
parent
b50da3dbd7
commit
9900eaa269
14
tests/extmod/ssl_cadata.py
Normal file
14
tests/extmod/ssl_cadata.py
Normal 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))
|
1
tests/extmod/ssl_cadata.py.exp
Normal file
1
tests/extmod/ssl_cadata.py.exp
Normal file
@ -0,0 +1 @@
|
||||
ValueError('invalid cert',)
|
Loading…
Reference in New Issue
Block a user