コード例 #1
0
ファイル: test_tree.py プロジェクト: bcrochet/khaleesi
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)
コード例 #2
0
ファイル: test_tree.py プロジェクト: Haoxing-Wang/InfraRed
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)
コード例 #3
0
ファイル: test_tree.py プロジェクト: bcrochet/khaleesi
def test_is_dict():
    import configure
    x = configure.Configuration({'foo': 'bar'})
    assert is_dict(x)
コード例 #4
0
ファイル: test_tree.py プロジェクト: Haoxing-Wang/InfraRed
def test_is_dict():
    import configure
    x = configure.Configuration({'foo': 'bar'})
    assert is_dict(x)