Skip to content

Commit 1a133ca

Browse files
authored
fix: add an explicit test that q can be non-float (#4667)
* fix: add an explicit test that `q` can be non-`float` This `suppress(ValueError)` was never tested: https://github.com/litestar-org/litestar/blob/55b69239fda945518f0dc69f7c511efb2d836c7f/litestar/datastructures/headers.py#L403-L404 * Remove a duplicate test case
1 parent 55b6923 commit 1a133ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/unit/test_datastructures/test_headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ def test_etag_to_header_weak() -> None:
358358
(
359359
("text/plain", ["text/plain"], "text/plain"),
360360
("text/plain", [MediaType.TEXT], MediaType.TEXT),
361-
("text/plain", ["text/plain"], "text/plain"),
362361
("text/plain", ["text/html"], None),
363362
("text/*", ["text/html"], "text/html"),
364363
("*/*", ["text/html"], "text/html"),
@@ -368,6 +367,7 @@ def test_etag_to_header_weak() -> None:
368367
("text/plain", ["text/*"], "text/plain"),
369368
("text/html", ["*/*"], "text/html"),
370369
("text/plain;q=0.8,text/html", ["text/plain", "text/html"], "text/html"),
370+
("text/plain;q=ab,text/html", ["text/plain", "text/html"], "text/plain"),
371371
("text/*,text/html", ["text/plain", "text/html"], "text/html"),
372372
),
373373
)

0 commit comments

Comments
 (0)