Mock an aiohttp request.
Definition at line 44 of file aiohttp.py.
◆ __init__()
| None homeassistant.util.aiohttp.MockRequest.__init__ |
( |
|
self, |
|
|
bytes |
content, |
|
|
str |
mock_source, |
|
|
str |
method = "GET", |
|
|
int |
status = HTTPStatus.OK, |
|
|
dict[str, str] | None |
headers = None, |
|
|
str | None |
query_string = None, |
|
|
str |
url = "" |
|
) |
| |
Initialize a request.
Definition at line 49 of file aiohttp.py.
◆ _prepare_hook()
| None homeassistant.util.aiohttp.MockRequest._prepare_hook |
( |
|
self, |
|
|
Any |
response |
|
) |
| |
|
private |
◆ _text()
| str homeassistant.util.aiohttp.MockRequest._text |
( |
|
self | ) |
|
|
private |
Return the body as text.
Definition at line 80 of file aiohttp.py.
◆ body_exists()
| bool homeassistant.util.aiohttp.MockRequest.body_exists |
( |
|
self | ) |
|
Return True if request has HTTP BODY, False otherwise.
Definition at line 90 of file aiohttp.py.
◆ content()
Return the body as text.
Definition at line 85 of file aiohttp.py.
◆ json()
| Any homeassistant.util.aiohttp.MockRequest.json |
( |
|
self, |
|
|
JSONDecoder |
loads = json_loads |
|
) |
| |
Return the body as JSON.
Definition at line 94 of file aiohttp.py.
◆ post()
| MultiDict[str] homeassistant.util.aiohttp.MockRequest.post |
( |
|
self | ) |
|
Return POST parameters.
Definition at line 98 of file aiohttp.py.
◆ query()
| MultiDict[str] homeassistant.util.aiohttp.MockRequest.query |
( |
|
self | ) |
|
Return a dictionary with the query variables.
Definition at line 75 of file aiohttp.py.
◆ text()
| str homeassistant.util.aiohttp.MockRequest.text |
( |
|
self | ) |
|
Return the body as text.
Definition at line 102 of file aiohttp.py.
◆ _content
| homeassistant.util.aiohttp.MockRequest._content |
|
private |
◆ _payload_writer
| homeassistant.util.aiohttp.MockRequest._payload_writer |
|
private |
◆ keep_alive
| homeassistant.util.aiohttp.MockRequest.keep_alive |
◆ method
| homeassistant.util.aiohttp.MockRequest.method |
◆ mock_source
| homeassistant.util.aiohttp.MockRequest.mock_source |
◆ None
| homeassistant.util.aiohttp.MockRequest.None |
|
static |
Mock an aiohttp request.
Definition at line 47 of file aiohttp.py.
◆ query_string
| homeassistant.util.aiohttp.MockRequest.query_string |
◆ status
| homeassistant.util.aiohttp.MockRequest.status |
◆ url
| homeassistant.util.aiohttp.MockRequest.url |
◆ version
| homeassistant.util.aiohttp.MockRequest.version |
The documentation for this class was generated from the following file: