MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_map

Method test_map

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

Source from the content-addressed store, hash-verified

1085
1086 @unittest.expectedFailure # TODO: RUSTPYTHON
1087 def test_map(self):
1088 self.assertEqual(list(map(operator.pow, range(3), range(1,7))),
1089 [0**1, 1**2, 2**3])
1090 self.assertEqual(list(map(tupleize, 'abc', range(5))),
1091 [('a',0),('b',1),('c',2)])
1092 self.assertEqual(list(map(tupleize, 'abc', count())),
1093 [('a',0),('b',1),('c',2)])
1094 self.assertEqual(take(2,map(tupleize, 'abc', count())),
1095 [('a',0),('b',1)])
1096 self.assertEqual(list(map(operator.pow, [])), [])
1097 self.assertRaises(TypeError, map)
1098 self.assertRaises(TypeError, list, map(None, range(3), range(3)))
1099 self.assertRaises(TypeError, map, operator.neg)
1100 self.assertRaises(TypeError, next, map(10, range(5)))
1101 self.assertRaises(ValueError, next, map(errfunc, [4], [5]))
1102 self.assertRaises(TypeError, next, map(onearg, [4], [5]))
1103
1104 def test_starmap(self):
1105 self.assertEqual(list(starmap(operator.pow, zip(range(3), range(1,7)))),

Callers

nothing calls this directly

Calls 5

listClass · 0.85
countFunction · 0.85
takeFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected