

def test_map_list(self):

    def mapTest(val, *args):
        return (val * 2)
    map = _([1, 2, 3, 4]).map(mapTest)
    self.assertEqual([2, 4, 6, 8], map, 'map for list did not work')
    map = _([1, 2, 3, 4]).collect(mapTest)
    self.assertEqual([2, 4, 6, 8], map, 'collect for list did not work')

dataset/ETHPy150Open serkanyersen/underscore.py/tests/test_collections.py TestCollections.test_map_list/original