Skip to content

Commit 38007df

Browse files
committed
Add test for int ambiguity
1 parent 023a034 commit 38007df

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_new.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ def test_set_new_list():
4242
assert dict['a'][0] is None
4343

4444

45+
def test_set_list_with_dict_int_ambiguity():
46+
d = {"list": [{"root": {"1": {"k": None}}}]}
47+
48+
dpath.new(d, "list/0/root/1/k", "new")
49+
50+
expected = {"list": [{"root": {"1": {"k": "new"}}}]}
51+
52+
assert d == expected
53+
54+
4555
def test_set_new_list_path_with_separator():
4656
# This test kills many birds with one stone, forgive me
4757
dict = {

0 commit comments

Comments
 (0)