MCPcopy Create free account
hub / github.com/pallets/quart / websocket

Method websocket

src/quart/testing/client.py:177–214  ·  view source on GitHub ↗
(
        self,
        path: str,
        *,
        headers: dict | Headers | None = None,
        query_string: dict | None = None,
        scheme: str = "ws",
        subprotocols: list[str] | None = None,
        root_path: str = "",
        http_version: str = "1.1",
        scope_base: dict | None = None,
        auth: Authorization | tuple[str, str] | None = None,
        subdomain: str | None = None,
    )

Source from the content-addressed store, hash-verified

175 )
176
177 def websocket(
178 self,
179 path: str,
180 *,
181 headers: dict | Headers | None = None,
182 query_string: dict | None = None,
183 scheme: str = "ws",
184 subprotocols: list[str] | None = None,
185 root_path: str = "",
186 http_version: str = "1.1",
187 scope_base: dict | None = None,
188 auth: Authorization | tuple[str, str] | None = None,
189 subdomain: str | None = None,
190 ) -> TestWebsocketConnectionProtocol:
191 headers, path, query_string_bytes = make_test_headers_path_and_query_string(
192 self.app,
193 path,
194 headers,
195 query_string,
196 auth,
197 subdomain,
198 )
199 if self.cookie_jar is not None:
200 for cookie in self.cookie_jar:
201 headers.add("cookie", f"{cookie.name}={cookie.value}")
202 scope = make_test_scope(
203 "websocket",
204 path,
205 "GET",
206 headers,
207 query_string_bytes,
208 scheme,
209 root_path,
210 http_version,
211 scope_base,
212 _preserve_context=self.preserve_context,
213 )
214 return self.websocket_connection_class(self.app, scope)
215
216 async def delete(self, *args: Any, **kwargs: Any) -> Response:
217 """Make a DELETE request.

Callers

nothing calls this directly

Calls 2

make_test_scopeFunction · 0.85

Tested by

no test coverage detected