Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dictdiffer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def check(key):
# otherwise, the change will be handled as `change` flag.
if path_limit and path_limit.path_is_limit(_node + [key]):
if _first[key] == _second[key]:
return
continue

yield CHANGE, _node + [key], (
deepcopy(_first[key]), deepcopy(_second[key])
Expand Down
13 changes: 13 additions & 0 deletions tests/test_dictdiffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,19 @@ def test_path_limit_addition(self):
for patch in res:
assert patch in diffed

first = {'input': {}, 'output': {}, 'forward': {'WWW': {'port': 80}}}
second = {
'input': {},
'output': {},
'forward': {'WWW': {'port': 80}, 'FTP': {'port': 21}},
}
diffed = list(diff(
first, second, path_limit=[('*', '*')], dot_notation=False
))

res = [('add', ['forward'], [('FTP', {'port': 21})])]
assert res == diffed

def test_path_limit_deletion(self):
first = {'author': {'last_name': 'Doe', 'first_name': 'John'}}
second = {}
Expand Down