def test_update_struct_with_dict(): class struct(object): a = 1 b = 2 s = struct() d = {'a': 3, 'c': 1} s = common.update_struct_with_dict(s, d) assert s.a == 3 assert s.b == 2 assert not hasattr(s, 'c')
def put_settings_proxy(settings): s = common.update_struct_with_dict(core.session.proxy(), settings) core.session.set_proxy(s)