Skip to content

Commit e4b59cf

Browse files
committed
adding a test case for delta and list of bytes
1 parent 687ea04 commit e4b59cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_delta.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,18 @@ def test_delta_set_in_objects(self):
18321832
delta_again = Delta(flat_rows_list=flat_expected)
18331833
assert delta.diff == delta_again.diff
18341834

1835+
def test_delta_array_of_bytes(self):
1836+
t1 = []
1837+
t2 = [b"hello"]
1838+
delta = Delta(DeepDiff(t1, t2))
1839+
flat_result = delta.to_flat_rows()
1840+
flat_expected = [FlatDeltaRow(path=[0], action=FlatDataAction.iterable_item_added, value=b'hello', type=bytes)]
1841+
assert flat_expected == flat_result
1842+
1843+
delta_again = Delta(flat_rows_list=flat_expected)
1844+
assert delta.diff == delta_again.diff
1845+
assert t1 + delta_again == t2
1846+
18351847
def test_delta_with_json_serializer(self):
18361848
t1 = {"a": 1}
18371849
t2 = {"a": 2}

0 commit comments

Comments
 (0)