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

Method test_connection

tests/sync/test_client.py:37–41  ·  view source on GitHub ↗

Client connects to server and the handshake succeeds.

(self)

Source from the content-addressed store, hash-verified

35
36class ClientTests(unittest.TestCase):
37 def test_connection(self):
38 """Client connects to server and the handshake succeeds."""
39 with run_server() as server:
40 with connect(get_uri(server)) as client:
41 self.assertEqual(client.protocol.state.name, "OPEN")
42
43 def test_existing_socket(self):
44 """Client connects using a pre-existing socket."""

Callers

nothing calls this directly

Calls 3

run_serverFunction · 0.85
get_uriFunction · 0.70
connectFunction · 0.50

Tested by

no test coverage detected