From 8ba32b878f015b65d7d619d1ca8a55251927f378 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 3 Dec 2024 12:42:34 +0100 Subject: [PATCH 1/2] Add tests for case insensitive keys --- tests/test_multidict.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_multidict.py b/tests/test_multidict.py index bcfa699c1..6530fbfd8 100644 --- a/tests/test_multidict.py +++ b/tests/test_multidict.py @@ -823,3 +823,14 @@ def test_keys__repr__(self, cls: Type[CIMultiDict[str]]) -> None: def test_values__repr__(self, cls: Type[CIMultiDict[str]]) -> None: d = cls([("KEY", "value1")], key="value2") assert repr(d.values()) == "_ValuesView('value1', 'value2')" + + @pytest.mark.xfail(reason="CI sets are not implemented yet") + def test_keys_case_insensitive_union( + self, + cls: Type[CIMultiDict[str]], + ) -> None: + d = cls([("KEY", "one"),]) + + assert "key" in d.keys() + assert d.keys().isdisjoint({"key"}) + assert {"key"} & d.keys() == {"KEY"} From 8a33440330f074fcb99e03389ce68079b8ce29f4 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 3 Dec 2024 13:22:18 +0100 Subject: [PATCH 2/2] Update tests/test_multidict.py Co-authored-by: Sam Bull --- tests/test_multidict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_multidict.py b/tests/test_multidict.py index 6530fbfd8..6f6b68d4b 100644 --- a/tests/test_multidict.py +++ b/tests/test_multidict.py @@ -833,4 +833,4 @@ def test_keys_case_insensitive_union( assert "key" in d.keys() assert d.keys().isdisjoint({"key"}) - assert {"key"} & d.keys() == {"KEY"} + assert {"key"} & d.keys() == {"key"}