Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
def test_is_dict():
    import configure
    x = configure.Configuration({'foo': 'bar'})
    assert is_dict(x)
Esempio n. 4
0
def test_is_dict():
    import configure
    x = configure.Configuration({'foo': 'bar'})
    assert is_dict(x)