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']
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']
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'