@property
def url(self) -> URL:
- if not hasattr(self, "_url"):
+ if not hasattr(self, "_url"): # pragma: no branch
self._url = URL(scope=self.scope)
return self._url
@property
def query_params(self) -> QueryParams:
- if not hasattr(self, "_query_params"):
+ if not hasattr(self, "_query_params"): # pragma: no branch
self._query_params = QueryParams(self.scope["query_string"])
return self._query_params
return self._body
async def json(self) -> typing.Any:
- if not hasattr(self, "_json"):
+ if not hasattr(self, "_json"): # pragma: no branch
body = await self.body()
self._json = json.loads(body)
return self._json
return AwaitableOrContextManagerWrapper(self._get_form(max_files=max_files, max_fields=max_fields))
async def close(self) -> None:
- if self._form is not None:
+ if self._form is not None: # pragma: no branch
await self._form.close()
async def is_disconnected(self) -> bool:
# Browsers don't send extra whitespace or semicolons in Cookie headers,
# but cookie_parser() should parse whitespace the same way
# document.cookie parses whitespace.
- # (" = b ; ; = ; c = ; ", {"": "b", "c": ""}),
+ (" = b ; ; = ; c = ; ", {"": "b", "c": ""}),
],
)
def test_cookies_invalid(