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

Method test_lists

Lib/test/test_descr.py:184–199  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

182 self.assertEqual(dictionary['a'], res)
183
184 def test_lists(self):
185 # Testing list operations...
186 # Asserts are within individual test methods
187 self.binop_test([1], [2], [1,2], "a+b", "__add__")
188 self.binop_test([1,2,3], 2, 1, "b in a", "__contains__")
189 self.binop_test([1,2,3], 4, 0, "b in a", "__contains__")
190 self.binop_test([1,2,3], 1, 2, "a[b]", "__getitem__")
191 self.sliceop_test([1,2,3], 0, 2, [1,2], "a[b:c]", "__getitem__")
192 self.setop_test([1], [2], [1,2], "a+=b", "__iadd__")
193 self.setop_test([1,2], 3, [1,2,1,2,1,2], "a*=b", "__imul__")
194 self.unop_test([1,2,3], 3, "len(a)", "__len__")
195 self.binop_test([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__")
196 self.binop_test([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__")
197 self.set2op_test([1,2], 1, 3, [1,3], "a[b]=c", "__setitem__")
198 self.setsliceop_test([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d",
199 "__setitem__")
200
201 def test_dicts(self):
202 # Testing dict operations...

Callers

nothing calls this directly

Calls 6

binop_testMethod · 0.95
sliceop_testMethod · 0.95
setop_testMethod · 0.95
unop_testMethod · 0.95
set2op_testMethod · 0.95
setsliceop_testMethod · 0.95

Tested by

no test coverage detected