

def test_map_dict(self):

    def mapTest(val, key, *args):
        return val.upper()
    map = _({
        'foo': 'bar',
        'bar': 'foo',
    }).map(mapTest)
    self.assertEqual({'BAR', 'FOO'}, set(map), 'map for dicts did not work')
    map = _({
        'foo': 'bar',
        'bar': 'foo',
    }).collect(mapTest)
    self.assertEqual({'BAR', 'FOO'}, set(self), 'collect for dicts did not work')

dataset/ETHPy150Open serkanyersen/underscore.py/tests/test_collections.py TestCollections.test_map_dict/VarMisuse@110/155 `map`->`self`