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

Method test_close_connection

tests/test_cli.py:91–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

89 )
90
91 def test_close_connection(self):
92 def wait_handler(websocket):
93 with self.assertRaises(ConnectionClosed):
94 websocket.recv()
95
96 with run_server(wait_handler) as server:
97 server_uri = get_uri(server)
98 output = self.run_main([server_uri], "", close_input=True)
99 self.assertEqual(
100 remove_commands_and_prompts(output),
101 add_connection_messages("", server_uri),
102 )
103
104 def test_connection_failure(self):
105 output = self.run_main(["ws://localhost:54321"], expected_exit_code=1)

Callers

nothing calls this directly

Calls 5

run_mainMethod · 0.95
run_serverFunction · 0.85
add_connection_messagesFunction · 0.85
get_uriFunction · 0.50

Tested by

no test coverage detected