Skip to content

Commit

Permalink
add test for get method
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Nov 28, 2024
1 parent dd6434f commit b44eb1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/monty/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class CaseInsensitiveDictBase(collections.UserDict, ABC):
`__delitem__`, `del dct[key]`, `pop(key)`
- Other operations:
getter (`__getitem__`)
getter (`__getitem__`, `get`)
membership check with `in` (`__contains__`)
Subclasses must implement the `_converter` static method to define
Expand Down
2 changes: 2 additions & 0 deletions tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def test_setter_and_getter(self):
self.upper_dict["B"] = 2
assert self.upper_dict["b"] == 2
assert self.upper_dict["B"] == 2
assert self.upper_dict.get("b") == 2
assert self.upper_dict.get("B") == 2

def test_update(self):
# Test with Mapping
Expand Down

0 comments on commit b44eb1a

Please sign in to comment.