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

Method test_chain_from_iterable

Lib/test/test_itertools.py:217–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

215 self.assertRaises(TypeError, list,c(2, 3))
216
217 def test_chain_from_iterable(self):
218 self.assertEqual(list(chain.from_iterable(['abc', 'def'])), list('abcdef'))
219 self.assertEqual(list(chain.from_iterable(['abc'])), list('abc'))
220 self.assertEqual(list(chain.from_iterable([''])), [])
221 self.assertEqual(take(4, chain.from_iterable(['abc', 'def'])), list('abcd'))
222 self.assertRaises(TypeError, list, chain.from_iterable([2, 3]))
223 self.assertEqual(list(islice(chain.from_iterable(repeat(range(5))), 2)), [0, 1])
224
225 def test_combinations(self):
226 self.assertRaises(TypeError, combinations, 'abc') # missing r argument

Callers

nothing calls this directly

Calls 5

listClass · 0.85
takeFunction · 0.85
repeatFunction · 0.50
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected