Fix MultiDict typing with multidict-6.0.0 (#64733)

This commit is contained in:
J. Nick Koston 2022-01-22 18:49:48 -10:00 committed by GitHub
parent b587e49300
commit 5d753abd79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,13 +44,13 @@ class MockRequest:
self.method = method
self.url = url
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._content = content
self.mock_source = mock_source
@property
def query(self) -> MultiDict[str]:
def query(self) -> MultiDict[str, str]:
"""Return a dictionary with the query variables."""
return MultiDict(parse_qsl(self.query_string, keep_blank_values=True))
@ -68,7 +68,7 @@ class MockRequest:
"""Return the body as JSON."""
return json.loads(self._text)
async def post(self) -> MultiDict[str]:
async def post(self) -> MultiDict[str, str]:
"""Return POST parameters."""
return MultiDict(parse_qsl(self._text, keep_blank_values=True))