Skip to content

Commit

Permalink
adding test cases for #344
Browse files Browse the repository at this point in the history
  • Loading branch information
seperman committed Nov 27, 2023
1 parent 17001c1 commit b775e4f
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion tests/test_ignore_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_nested_list_with_dictionarry_difference_ignore_order(self):
result = {}
assert result == ddiff

def test_list_difference_ignore_order_report_repetition(self):
def test_list_difference_ignore_order_report_repetition1(self):
t1 = [1, 3, 1, 4]
t2 = [4, 4, 1]
ddiff = DeepDiff(t1, t2, ignore_order=True, report_repetition=True)
Expand All @@ -176,6 +176,43 @@ def test_list_difference_ignore_order_report_repetition(self):
}
assert result == ddiff

@pytest.mark.skip
def test_list_difference_ignore_order_report_repetition2(self):
t1 = [1, 1, 1]
t2 = [2, 2]
ddiff = DeepDiff(t1, t2, ignore_order=True)
result = {'values_changed': {'root[0]': {'new_value': 2, 'old_value': 1}}}
assert result == ddiff

ddiff2 = DeepDiff(t1, t2, ignore_order=True, report_repetition=True, cutoff_intersection_for_pairs=1, cutoff_distance_for_pairs=1)
result2 = {
'iterable_item_removed': {
'root[0]': 1,
'root[1]': 1,
'root[2]': 1
},
'iterable_item_added': {
'root[0]': 2,
'root[1]': 2,
},
}
assert result2 == ddiff2

@pytest.mark.skip
def test_list_difference_ignore_order_report_repetition3(self):
t1 = [{"id": 1}, {"id": 1}, {"id": 1}]
t2 = [{"id": 1, "name": 1}]

ddiff2 = DeepDiff(t1, t2, ignore_order=True, report_repetition=True, cutoff_intersection_for_pairs=1, cutoff_distance_for_pairs=1)
result2 = {
'iterable_item_removed': {
'root[1]': {"id": 1},
'root[2]': {"id": 1},
},
'dictionary_item_added': ["root[0]['name']"]
}
assert result2 == ddiff2

def test_nested_list_ignore_order_report_repetition(self):
t1 = [1, 2, [3, 4]]
t2 = [[4, 3, 3], 2, 1]
Expand Down

0 comments on commit b775e4f

Please sign in to comment.