Esempio n. 1
0
def test_registry_updated_with_new_dict_adds_those_items():
    items = {'a': 10}
    reg = Registry().add(items)
    newitems = {'a': 20, 'b': 100}
    reg.add(newitems)
    assert reg.resolve()['a'] == newitems['a']
    assert reg.resolve()['b'] == newitems['b']
Esempio n. 2
0
def test_variable_subst_handles_escaped_chars():
    items = {'a': '${path}'}
    repl = {'path': 'D\\'}
    reg = Registry()
    config = reg.add(items).add(repl)

    assert config.resolve()['a'] == repl['path']
Esempio n. 3
0
def test_attribute_names_are_resolved_with_variables():
    public_args = {'password': '******'}
    overrides = {'private_password': '******'}
    registry = Registry()
    config = registry.add(public_args).add(overrides).resolve()

    assert config.password == 'a good strong password'