def test_init_dict(): d = {'foo': 'bar'} tree = OrderedTree('.', **d) print_yaml("tree init using a dict", tree) assert 'foo' in tree assert tree['foo'] == 'bar' d2 = {'foo': {'bar': 'baz'}} tree = OrderedTree('.', **d2) print_yaml("tree init using a complex dict", tree) assert 'foo.bar' in tree assert tree['foo.bar'] == 'baz' import configure x = configure.Configuration({'foo': 'bar'}) assert is_dict(x)
def test_init_dict(): d = { 'foo': 'bar' } tree = OrderedTree('.', **d) print_yaml("tree init using a dict", tree) assert 'foo' in tree assert tree['foo'] == 'bar' d2 = { 'foo': { 'bar': 'baz' } } tree = OrderedTree('.', **d2) print_yaml("tree init using a complex dict", tree) assert 'foo.bar' in tree assert tree['foo.bar'] == 'baz' import configure x = configure.Configuration({'foo': 'bar'}) assert is_dict(x)
def test_is_dict(): import configure x = configure.Configuration({'foo': 'bar'}) assert is_dict(x)