MCPcopy Create free account
hub / github.com/python-websockets/websockets / test_not_found

Method test_not_found

tests/asyncio/test_router.py:103–112  ·  view source on GitHub ↗

Router rejects requests to unknown paths with an HTTP 404 error.

(self)

Source from the content-addressed store, hash-verified

101 )
102
103 async def test_not_found(self):
104 """Router rejects requests to unknown paths with an HTTP 404 error."""
105 async with route(self.url_map, "localhost", 0) as server:
106 with self.assertRaises(InvalidStatus) as raised:
107 async with connect(get_uri(server) + "/n"):
108 self.fail("did not raise")
109 self.assertEqual(
110 str(raised.exception),
111 "server rejected WebSocket connection: HTTP 404",
112 )
113
114 async def test_process_request_function_returning_none(self):
115 """Router supports a process_request function returning None."""

Callers

nothing calls this directly

Calls 4

connectFunction · 0.90
failMethod · 0.80
get_uriFunction · 0.70
routeFunction · 0.50

Tested by

no test coverage detected