MCPcopy Index your code
hub / github.com/python-websockets/websockets / assertHandshakeError

Method assertHandshakeError

tests/test_server.py:340–349  ·  view source on GitHub ↗

Assert that the opening handshake failed with the given exception.

(self, server, exc_type, msg)

Source from the content-addressed store, hash-verified

338 self.assertIsNone(server.handshake_exc)
339
340 def assertHandshakeError(self, server, exc_type, msg):
341 """Assert that the opening handshake failed with the given exception."""
342 self.assertEqual(server.state, CONNECTING)
343 self.assertIsInstance(server.handshake_exc, exc_type)
344 exc = server.handshake_exc
345 exc_str = str(exc)
346 while exc.__cause__ is not None:
347 exc = exc.__cause__
348 exc_str += "; " + str(exc)
349 self.assertEqual(exc_str, msg)
350
351 def test_basic(self):
352 """Handshake succeeds."""

Callers 15

test_missing_upgradeMethod · 0.95
test_invalid_upgradeMethod · 0.95
test_missing_keyMethod · 0.95
test_multiple_keyMethod · 0.95
test_invalid_keyMethod · 0.95
test_truncated_keyMethod · 0.95
test_missing_versionMethod · 0.95
test_multiple_versionMethod · 0.95
test_invalid_versionMethod · 0.95
test_no_originMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected