示例#1
0
def test_dict_interface_update_with_kwargs():
    d = DogmaticDict()
    d['a'] = 12
    d['b'] = 'foo'
    d.update(a=2, b=3)
    assert d['a'] == 2
    assert d['b'] == 3
示例#2
0
def test_dict_interface_update_with_kwargs():
    d = DogmaticDict()
    d['a'] = 12
    d['b'] = 'foo'
    d.update(a=2, b=3)
    assert d['a'] == 2
    assert d['b'] == 3
示例#3
0
def test_dict_interface_update_with_kwargs():
    d = DogmaticDict()
    d["a"] = 12
    d["b"] = "foo"
    d.update(a=2, b=3)
    assert d["a"] == 2
    assert d["b"] == 3
示例#4
0
def test_dict_interface_update_with_list_of_items():
    d = DogmaticDict()
    d['a'] = 12
    d['b'] = 'foo'
    d.update([('b', 9), ('c', 7)])
    assert d['a'] == 12
    assert d['b'] == 9
    assert d['c'] == 7
示例#5
0
def test_dict_interface_update_with_list_of_items():
    d = DogmaticDict()
    d['a'] = 12
    d['b'] = 'foo'
    d.update([('b', 9), ('c', 7)])
    assert d['a'] == 12
    assert d['b'] == 9
    assert d['c'] == 7
示例#6
0
def test_dict_interface_update_with_list_of_items():
    d = DogmaticDict()
    d["a"] = 12
    d["b"] = "foo"
    d.update([("b", 9), ("c", 7)])
    assert d["a"] == 12
    assert d["b"] == 9
    assert d["c"] == 7
示例#7
0
def test_dict_interface_update_with_dict():
    d = DogmaticDict()
    d['a'] = 12
    d['b'] = 'foo'

    d.update({'a': 1, 'c': 2})
    assert d['a'] == 1
    assert d['b'] == 'foo'
    assert d['c'] == 2
示例#8
0
def test_dict_interface_update_with_dict():
    d = DogmaticDict()
    d['a'] = 12
    d['b'] = 'foo'

    d.update({'a': 1, 'c': 2})
    assert d['a'] == 1
    assert d['b'] == 'foo'
    assert d['c'] == 2
示例#9
0
def test_dict_interface_update_with_dict():
    d = DogmaticDict()
    d["a"] = 12
    d["b"] = "foo"

    d.update({"a": 1, "c": 2})
    assert d["a"] == 1
    assert d["b"] == "foo"
    assert d["c"] == 2
示例#10
0
def test_fixed_value_fixed():
    d = DogmaticDict({'a': 7})
    d['a'] = 8
    assert d['a'] == 7

    del d['a']
    assert 'a' in d
    assert d['a'] == 7

    d.update([('a', 9), ('b', 12)])
    assert d['a'] == 7

    d.update({'a': 9, 'b': 12})
    assert d['a'] == 7

    d.update(a=10, b=13)
    assert d['a'] == 7
示例#11
0
def test_fixed_value_fixed():
    d = DogmaticDict({'a': 7})
    d['a'] = 8
    assert d['a'] == 7

    del d['a']
    assert 'a' in d
    assert d['a'] == 7

    d.update([('a', 9), ('b', 12)])
    assert d['a'] == 7

    d.update({'a': 9, 'b': 12})
    assert d['a'] == 7

    d.update(a=10, b=13)
    assert d['a'] == 7
示例#12
0
def test_fixed_value_fixed():
    d = DogmaticDict({"a": 7})
    d["a"] = 8
    assert d["a"] == 7

    del d["a"]
    assert "a" in d
    assert d["a"] == 7

    d.update([("a", 9), ("b", 12)])
    assert d["a"] == 7

    d.update({"a": 9, "b": 12})
    assert d["a"] == 7

    d.update(a=10, b=13)
    assert d["a"] == 7