From 0caf91bad29ea51bbac9357008deecc277d4dfda Mon Sep 17 00:00:00 2001 From: Peter Schutt Date: Sun, 25 Jun 2023 19:31:59 +1000 Subject: [PATCH] Fix test. --- tests/unit/test_signature/test_parsing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_signature/test_parsing.py b/tests/unit/test_signature/test_parsing.py index 0ab998822f..1cda0d16b8 100644 --- a/tests/unit/test_signature/test_parsing.py +++ b/tests/unit/test_signature/test_parsing.py @@ -15,6 +15,7 @@ from litestar.params import Body, Dependency, Parameter from litestar.status_codes import HTTP_200_OK, HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST, HTTP_500_INTERNAL_SERVER_ERROR from litestar.testing import RequestFactory, TestClient, create_test_client +from litestar.types.empty import Empty from litestar.types.helper_types import OptionalSequence from litestar.utils.signature import ParsedSignature @@ -73,7 +74,8 @@ def my_fn(a: int, b: str, c: Optional[bytes], d: bytes = b"123", e: Optional[dic assert fields["b"].field_type is str assert not fields["b"].is_optional assert fields["c"].field_type is Optional[bytes] - assert not fields["c"].is_optional + assert fields["c"].is_optional + assert fields["c"].default_value is Empty assert fields["d"].field_type is bytes assert fields["d"].default_value == b"123" assert fields["e"].field_type == Optional[dict]