示例#1
0
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')
示例#2
0
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')
示例#3
0
def put_settings_proxy(settings):
    s = common.update_struct_with_dict(core.session.proxy(), settings)
    core.session.set_proxy(s)