示例#1
0
 def test_one(self):
     self.assertEqual(iterutils.map_iterable(len, 'foo'), 3)
示例#2
0
 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])
示例#3
0
 def test_none(self):
     self.assertEqual(iterutils.map_iterable(len, None), None)