def test_remove_keys(): # Remove all a's eq_(utils.remove_keys(d, "a"), {"b": 2, "x": {"c": 4}}) # Remove all a's and b's eq_(utils.remove_keys(d, ("a", "b")), {"x": {"c": 4}})
def post_process(obj): if args.trim: obj = remove_keys(obj, args.trim) if args.z: obj = filter_dict_empty(obj) return obj