Ejemplo n.º 1
0
def test_add_to_config_multiple():
    conf = {}

    new_conf = config.add_item_to_config(conf, 'a.b.c', 'd')
    assert new_conf == {'a': {'b': {'c': ['d']}}}

    new_conf = config.add_item_to_config(new_conf, 'a.b.c', 'e')
    assert new_conf == {'a': {'b': {'c': ['d', 'e']}}}
def test_add_to_config_multiple():
    conf = {}

    new_conf = config.add_item_to_config(conf, "a.b.c", "d")
    assert new_conf == {"a": {"b": {"c": ["d"]}}}

    new_conf = config.add_item_to_config(new_conf, "a.b.c", "e")
    assert new_conf == {"a": {"b": {"c": ["d", "e"]}}}
Ejemplo n.º 3
0
def test_remove_from_config():
    conf = {}

    new_conf = config.add_item_to_config(conf, 'a.b.c', 'd')
    new_conf = config.add_item_to_config(new_conf, 'a.b.c', 'e')
    assert new_conf == {'a': {'b': {'c': ['d', 'e']}}}

    new_conf = config.remove_item_from_config(new_conf, 'a.b.c', 'e')
    assert new_conf == {'a': {'b': {'c': ['d']}}}
def test_remove_from_config():
    conf = {}

    new_conf = config.add_item_to_config(conf, "a.b.c", "d")
    new_conf = config.add_item_to_config(new_conf, "a.b.c", "e")
    assert new_conf == {"a": {"b": {"c": ["d", "e"]}}}

    new_conf = config.remove_item_from_config(new_conf, "a.b.c", "e")
    assert new_conf == {"a": {"b": {"c": ["d"]}}}
Ejemplo n.º 5
0
def test_add_to_config_one_level():
    conf = {}

    new_conf = config.add_item_to_config(conf, 'a.b', 'c')
    assert new_conf == {'a': {'b': ['c']}}
Ejemplo n.º 6
0
def test_add_to_config_zero_level():
    conf = {}

    new_conf = config.add_item_to_config(conf, 'a', 'b')
    assert new_conf == {'a': ['b']}
def test_add_to_config_one_level():
    conf = {}

    new_conf = config.add_item_to_config(conf, "a.b", "c")
    assert new_conf == {"a": {"b": ["c"]}}
def test_add_to_config_zero_level():
    conf = {}

    new_conf = config.add_item_to_config(conf, "a", "b")
    assert new_conf == {"a": ["b"]}