Skip to content

Commit 25546ce

Browse files
committed
adding one more test
1 parent 1c643cb commit 25546ce

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/test_ignore_order.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,41 @@ def test_ignore_order_and_group_by2(self):
788788
expected = {'values_changed': {"root['1']['codes'][2]": {'new_value': '4', 'old_value': '3'}}}
789789
assert expected == diff
790790

791+
def test_ignore_order_and_group_by3(self):
792+
t1 = [{
793+
'id':
794+
'5ec52e',
795+
'products': [{
796+
'lineNumber': 1,
797+
'productPrice': '2.39',
798+
'productQuantity': 2
799+
}, {
800+
'lineNumber': 2,
801+
'productPrice': '4.44',
802+
'productQuantity': 1
803+
}],
804+
}]
805+
806+
t2 = [{
807+
'id':
808+
'5ec52e',
809+
'products': [
810+
{
811+
'lineNumber': 2,
812+
'productPrice': '4.44',
813+
'productQuantity': 1
814+
},
815+
{
816+
'lineNumber': 1,
817+
'productPrice': '2.39',
818+
'productQuantity': 2
819+
},
820+
],
821+
}]
822+
823+
diff = DeepDiff(t1, t2, group_by='id', ignore_order=True)
824+
assert {} == diff
825+
791826

792827
class TestCompareFuncIgnoreOrder:
793828

0 commit comments

Comments
 (0)