(
selenium_coverage: typing.Any, http_host: str, http_port: int, https_port: int
)
| 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, |
no test coverage detected