Beispiel #1
0
def test_dig_dict_iter():
    # type: () -> None
    "Should "
    assert dig.dig({'foo': (1, 2)}, 'foo.0') == 1
Beispiel #2
0
def test_dig_iter():
    # type: () -> None
    "Should "
    assert dig.dig((1, 2, 3, (41, 42, 43)), "3.0") == 41
Beispiel #3
0
def test_dig_object():
    # type: () -> None
    "Should "
    assert dig.dig(E(foo='bar', bar=E(jox='jox')), 'bar.jox') == 'jox'
Beispiel #4
0
def test_dig_complex():
    # type: () -> None
    "Should "
    ob = E(foo=1, bar=2, fx=(1, 2, 3))
    assert dig.dig(ob, 'f*.1.0') == 1
Beispiel #5
0
def test_dig_dict_nested():
    # type: () -> None
    "Should "
    assert dig.dig({'foo': {'bar': 'baz'}}, 'foo.bar') == 'baz'