コード例 #1
0
ファイル: test_dpath.py プロジェクト: edwardgeorge/drivel
def test_non_existant_path():
    data = {'foo': 'bar'}
    dpath(data, '/doesnotexit')
コード例 #2
0
ファイル: test_dpath.py プロジェクト: edwardgeorge/drivel
def test_basic():
    data = {'foo': {'bar': [1, 2, 3]}}
    assert dpath(data, '/foo/bar') == [1, 2, 3]
コード例 #3
0
ファイル: test_dpath.py プロジェクト: edwardgeorge/drivel
def test_string_in_path():
    data = {'foo': "hello world"}
    dpath(data, '/foo/3')
コード例 #4
0
ファイル: test_dpath.py プロジェクト: edwardgeorge/drivel
def test_lists():
    data = {'foo': ['a', 'b', 'c']}
    assert dpath(data, '/foo/1') == 'b'