def test_apply_alias(self): def foo(d): d["x"] *= 2 return d d = {"a": 1, "b": 3} result = apply_alias(foo, {"b": "x"})(d) self.assertDictEqual({"a": 1, "b": 6}, result)
def test_apply_alias(self): def foo(d): d['x'] *= 2 return d d = {'a': 1, 'b': 3} result = apply_alias(foo, {'b': 'x'})(d) self.assertDictEqual({'a': 1, 'b': 6}, result)