Skip to content

Commit ffd86de

Browse files
committed
Add tests for recent fixes
1 parent a86dac7 commit ffd86de

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/test_context.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,17 @@ def test_load_verify_locations_with_cafile(ssl_context):
7474

7575
def test_load_verify_locations_with_cadata(ssl_context):
7676
ssl_context.load_verify_locations(cadata=_CADATA)
77+
78+
79+
def test_check_hostname_requires_cert_required(ssl_provider, ssl_context):
80+
with pytest.raises(ValueError):
81+
ssl_context.check_hostname = True
82+
83+
ssl_context.verify_mode = ssl_provider.CERT_REQUIRED
84+
ssl_context.check_hostname = True
85+
assert ssl_context.check_hostname is True
86+
87+
88+
def test_wrap_socket_server_side_mismatch(ssl_context, tcp_socket):
89+
with pytest.raises(ValueError):
90+
ssl_context.wrap_socket(tcp_socket, server_side=True)

0 commit comments

Comments
 (0)