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

Method test_connection

tests/asyncio/test_client.py:854–859  ·  view source on GitHub ↗

Client connects to server over a Unix socket.

(self)

Source from the content-addressed store, hash-verified

852@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "this test requires Unix sockets")
853class UnixClientTests(unittest.IsolatedAsyncioTestCase):
854 async def test_connection(self):
855 """Client connects to server over a Unix socket."""
856 with temp_unix_socket_path() as path:
857 async with unix_serve(handler, path):
858 async with unix_connect(path) as client:
859 self.assertEqual(client.protocol.state.name, "OPEN")
860
861 async def test_set_host_header(self):
862 """Client sets the Host header to the host in the WebSocket URI."""

Callers

nothing calls this directly

Calls 3

unix_serveFunction · 0.90
temp_unix_socket_pathFunction · 0.85
unix_connectFunction · 0.50

Tested by

no test coverage detected