Skip to content

Commit 8357063

Browse files
committed
update tests
1 parent 6a6c7a5 commit 8357063

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/unit/test_websocket_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def test_verify_false(self, mock_session) -> None:
234234
mock_session._session.verify = False
235235
mock_session._session.cert = None
236236
client = _MistWebsocket(mock_session, channels=["/ch"])
237-
assert client._build_sslopt() == {"cert_reqs": ssl.CERT_NONE}
237+
assert client._build_sslopt() == {"cert_reqs": ssl.CERT_NONE, "check_hostname": False}
238238

239239
def test_verify_custom_ca_path(self, mock_session) -> None:
240240
mock_session._session.verify = "/etc/ssl/custom-ca.pem"
@@ -270,6 +270,7 @@ def test_verify_false_with_cert_tuple(self, mock_session) -> None:
270270
sslopt = client._build_sslopt()
271271
assert sslopt == {
272272
"cert_reqs": ssl.CERT_NONE,
273+
"check_hostname": False,
273274
"certfile": "/path/cert.pem",
274275
"keyfile": "/path/key.pem",
275276
}
@@ -536,7 +537,7 @@ def test_passes_sslopt_when_verify_false(self, mock_session) -> None:
536537
mock_ws.run_forever.assert_called_once_with(
537538
ping_interval=30,
538539
ping_timeout=10,
539-
sslopt={"cert_reqs": ssl.CERT_NONE},
540+
sslopt={"cert_reqs": ssl.CERT_NONE, "check_hostname": False},
540541
)
541542

542543
def test_exception_triggers_error_and_close_handlers(self, ws_client) -> None:

0 commit comments

Comments
 (0)