Skip to content
Snippets Groups Projects
Verified Commit 38f3c822 authored by dos's avatar dos
Browse files

sim: fakes: urequests: Pass stream=True to mocked functions

Otherwise raw.read does not work.
parent 2926098a
Branches
Tags
No related merge requests found
from typing import Any import requests
from requests import Response, request, head, get, post, put, patch, delete
def mkmock(fn):
def mocked(*args, **kwargs):
# print(fn, *args, *kwargs)
return fn(*args, stream=True)
return mocked
request = mkmock(requests.request)
head = mkmock(requests.head)
get = mkmock(requests.get)
post = mkmock(requests.post)
put = mkmock(requests.put)
patch = mkmock(requests.patch)
delete = mkmock(requests.delete)
Response = requests.Response
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment