nested tests

This commit is contained in:
John Lancaster
2026-02-21 23:19:43 -06:00
parent 0980145b10
commit 7c3e073c54

View File

@@ -53,12 +53,14 @@ class TestHookedList:
class TestMutableOps:
def test_setitem(self):
added = []
lst = HookedList(lambda e: added.append(e.item), existing=[1, 2, 3])
lst = HookedList(lambda e: added.append(e.item), existing=[1, 2, [4, 5, [6, 7]]])
lst[0] = 10
lst.append(20)
assert list(lst) == [10, 2, 3, 20]
assert added == [10, 20]
lst[2][-1].append(8)
assert added == [10, 20, 8]
def test_delitem(self):
lst = HookedList(None, existing=[1, 2, 3])
del lst[1]