Browse Source

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

For coverage.

Signed-off-by: Damien George <damien@micropython.org>
pull/11862/head
Damien George 1 year ago
parent
commit
9900eaa269
  1. 14
      tests/extmod/ssl_cadata.py
  2. 1
      tests/extmod/ssl_cadata.py.exp

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

1
tests/extmod/ssl_cadata.py.exp

@ -0,0 +1 @@
ValueError('invalid cert',)
Loading…
Cancel
Save