MCPcopy
hub / github.com/urllib3/urllib3 / test_404

Function test_404

test/contrib/emscripten/test_emscripten.py:198–212  ·  view source on GitHub ↗
(selenium_coverage: typing.Any, testserver_http: PyodideServerInfo)

Source from the content-addressed store, hash-verified

196
197
198def test_404(selenium_coverage: typing.Any, testserver_http: PyodideServerInfo) -> None:
199 @run_in_pyodide # type: ignore[untyped-decorator]
200 def pyodide_test(selenium_coverage, host: str, port: int) -> None: # type: ignore[no-untyped-def]
201 from urllib3.connection import HTTPConnection
202 from urllib3.response import BaseHTTPResponse
203
204 conn = HTTPConnection(host, port)
205 conn.request("GET", f"http://{host}:{port}/status?status=404 NOT FOUND")
206 response = conn.getresponse()
207 assert isinstance(response, BaseHTTPResponse)
208 assert response.status == 404
209
210 pyodide_test(
211 selenium_coverage, testserver_http.http_host, testserver_http.http_port
212 )
213
214
215# setting timeout should show a warning to js console

Callers

nothing calls this directly

Calls 1

pyodide_testFunction · 0.85

Tested by

no test coverage detected