def test_one(self): self.assertEqual(iterutils.map_iterable(len, 'foo'), 3)
def test_many(self): self.assertEqual(iterutils.map_iterable(len, ['foo', 'bars']), [3, 4]) self.assertEqual(iterutils.map_iterable(len, ('foo', 'bars')), (3, 4)) self.assertEqual(iterutils.map_iterable(len, iter(('foo', 'bars'))), [3, 4])
def test_none(self): self.assertEqual(iterutils.map_iterable(len, None), None)