MCPcopy Index your code
hub / github.com/python/cpython / test_setdelitem

Method test_setdelitem

Lib/test/test_index.py:166–180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 seq = [0,10,20,30,40,50]
165
166 def test_setdelitem(self):
167 self.o.ind = -2
168 self.n.ind = 2
169 lst = list('ab!cdefghi!j')
170 del lst[self.o]
171 del lst[self.n]
172 lst[self.o] = 'X'
173 lst[self.n] = 'Y'
174 self.assertEqual(lst, list('abYdefghXj'))
175
176 lst = [5, 6, 7, 8, 9, 10, 11]
177 lst.__setitem__(self.n, "here")
178 self.assertEqual(lst, [5, 6, "here", 8, 9, 10, 11])
179 lst.__delitem__(self.n)
180 self.assertEqual(lst, [5, 6, 8, 9, 10, 11])
181
182 def test_inplace_repeat(self):
183 self.o.ind = 2

Callers

nothing calls this directly

Calls 4

listClass · 0.85
assertEqualMethod · 0.45
__setitem__Method · 0.45
__delitem__Method · 0.45

Tested by

no test coverage detected