Skip to content

Commit

Permalink
✅ Ensure None can be used as a default value for Cut.get, Cut.pop and…
Browse files Browse the repository at this point in the history
… Cut.setdefault.
  • Loading branch information
ducdetronquito committed Mar 25, 2020
1 parent e1defaf commit 9e66d34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def test_get(self, dict_type, data, key, result):
@pytest.mark.parametrize(
"data,key,default",
[
({}, "b", None),
({"a": 42}, "b", "default"),
({"a": {"b": 42}}, "a.c", "default"),
({"a": {"b": {"c": 42}}}, "a.b.d", "default"),
Expand Down Expand Up @@ -433,6 +434,7 @@ def test_pop(self, dict_type, data, key, result):
@pytest.mark.parametrize(
"data,key,default",
[
({}, "b", None),
({"a": 1}, "b", 42),
({"a": {"b": 1}}, "c.b", 42),
({"a": {"b": 1}}, "a.c", 42),
Expand Down Expand Up @@ -561,6 +563,7 @@ def test_setdefault(self, dict_type, data, key, result):
@pytest.mark.parametrize(
"data,key,default",
[
({}, "b", None),
({"a": 1}, "b", "default"),
({"a": {"b": 1}}, "a.c", "default"),
({"a": {"b": {"c": 1}}}, "a.b.d", "default"),
Expand Down

0 comments on commit 9e66d34

Please sign in to comment.