Skip to content
Snippets Groups Projects
Commit fb602352 authored by rahix's avatar rahix
Browse files

sim: Mock `urequests` using `requests`

parent 964beaa7
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !209. Comments created here will be created in the context of that merge request.
from typing import Any
class Response:
text: str
content: bytes
status_code: int
def close(self) -> None:
...
def json(self) -> Any:
...
def request(
method: str, url: str, data: Any, json: Any, headers: dict[str, str]
) -> Response:
...
def head(url: str, **kw: Any) -> Response:
...
def get(url: str, **kw: Any) -> Response:
...
def post(url: str, **kw: Any) -> Response:
...
def put(url: str, **kw: Any) -> Response:
...
def patch(url: str, **kw: Any) -> Response:
...
def delete(url: str, **kw: Any) -> Response:
...
from requests import Response, request, head, get, post, put, patch, delete
......@@ -16,6 +16,11 @@ import cmath
import wasmer
import wasmer_compiler_cranelift
try:
import requests
except ImportError:
print("Warning: `requests` is missing so no `urequests` mock will exist")
sys_path_orig = sys.path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment