Skip to content

Commit

Permalink
at least test init
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Dec 1, 2024
1 parent c3fa365 commit f5b651d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@ def test_converter(self):
tup_key = (1, 2, 3)
assert CaseInsensitiveDictLower._converter(tup_key) == (1, 2, 3)

def test_init(self):
# Test init from Mapping
dct = CaseInsensitiveDictLower({"key1": "value1", "Key2": "value2"})
assert dct["key1"] == "value1"
assert dct["KEY1"] == "value1"
assert dct["Key2"] == "value2"
assert dct["key2"] == "value2"

# Test init from Iterable
dct = CaseInsensitiveDictLower([("key1", "value1"), ("Key2", "value2")])
assert dct["key1"] == "value1"
assert dct["KEY1"] == "value1"
assert dct["Key2"] == "value2"
assert dct["key2"] == "value2"

# Test init with kwargs
dct = CaseInsensitiveDictLower(key1="value1", Key2="value2")
assert dct["key1"] == "value1"
assert dct["KEY1"] == "value1"
assert dct["Key2"] == "value2"
assert dct["key2"] == "value2"


class TestTree:
def test_tree(self):
Expand Down

0 comments on commit f5b651d

Please sign in to comment.