mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 10:17:51 +00:00
Fix MultiDict typing with multidict-6.0.0 (#64733)
This commit is contained in:
parent
b587e49300
commit
5d753abd79
@ -44,13 +44,13 @@ class MockRequest:
|
|||||||
self.method = method
|
self.method = method
|
||||||
self.url = url
|
self.url = url
|
||||||
self.status = status
|
self.status = status
|
||||||
self.headers: CIMultiDict[str] = CIMultiDict(headers or {})
|
self.headers: CIMultiDict[str, str] = CIMultiDict(headers or {})
|
||||||
self.query_string = query_string or ""
|
self.query_string = query_string or ""
|
||||||
self._content = content
|
self._content = content
|
||||||
self.mock_source = mock_source
|
self.mock_source = mock_source
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def query(self) -> MultiDict[str]:
|
def query(self) -> MultiDict[str, str]:
|
||||||
"""Return a dictionary with the query variables."""
|
"""Return a dictionary with the query variables."""
|
||||||
return MultiDict(parse_qsl(self.query_string, keep_blank_values=True))
|
return MultiDict(parse_qsl(self.query_string, keep_blank_values=True))
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class MockRequest:
|
|||||||
"""Return the body as JSON."""
|
"""Return the body as JSON."""
|
||||||
return json.loads(self._text)
|
return json.loads(self._text)
|
||||||
|
|
||||||
async def post(self) -> MultiDict[str]:
|
async def post(self) -> MultiDict[str, str]:
|
||||||
"""Return POST parameters."""
|
"""Return POST parameters."""
|
||||||
return MultiDict(parse_qsl(self._text, keep_blank_values=True))
|
return MultiDict(parse_qsl(self._text, keep_blank_values=True))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user