MCPcopy
hub / github.com/urllib3/urllib3 / test_fn

Function test_fn

test/contrib/emscripten/test_emscripten.py:680–694  ·  view source on GitHub ↗
(
        selenium_coverage: typing.Any, http_host: str, http_port: int, https_port: int
    )

Source from the content-addressed store, hash-verified

678) -> None:
679 @run_in_pyodide(packages=["micropip"]) # type: ignore[untyped-decorator]
680 async def test_fn(
681 selenium_coverage: typing.Any, http_host: str, http_port: int, https_port: int
682 ) -> None:
683 import micropip # type: ignore[import-not-found]
684
685 await micropip.install("requests")
686 import requests
687
688 r = requests.get(f"http://{http_host}:{http_port}/")
689 assert r.status_code == 200
690 assert r.text == "Dummy server!"
691 json_data = {"woo": "yay"}
692 # try posting some json with requests on https
693 r = requests.post(f"https://{http_host}:{https_port}/echo_json", json=json_data)
694 assert r.json() == json_data
695
696 test_fn(
697 selenium_coverage,

Callers 1

Calls 3

installMethod · 0.80
getMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected