You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
774 B
29 lines
774 B
# Test MicroPython-specific behaviour of ssl.SSLContext.
|
|
|
|
try:
|
|
import ssl
|
|
except ImportError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
# Test constructing without any arguments (in CPython it's a DeprecationWarning).
|
|
try:
|
|
ssl.SSLContext()
|
|
except TypeError:
|
|
print("TypeError")
|
|
|
|
# Test attributes that don't exist (in CPython new attributes can be added).
|
|
# This test is needed for coverage because SSLContext implements a custom attr handler.
|
|
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
|
try:
|
|
ctx.does_not_exist
|
|
except AttributeError:
|
|
print("AttributeError on load")
|
|
try:
|
|
ctx.does_not_exist = None
|
|
except AttributeError:
|
|
print("AttributeError on store")
|
|
try:
|
|
del ctx.does_not_exist
|
|
except AttributeError:
|
|
print("AttributeError on delete")
|
|
|