def test_Map_apply(): m = Map.fromkeys('abc', lambda x: x + 1) n = Map({'a': 1, 'b': 2, 'c': 3}) o = m * n assert o.v == {'a': 2, 'b': 3, 'c': 4}
def test_Map_fromkeys(): m = Map.fromkeys(['a', 'b', 'c'], 1) assert isinstance(m, Map) assert m.v == {'a': 1, 'b': 1, 'c': 1} assert Map.fromkeys(['a']).v == {'a': None}