Beispiel #1
0
def test_path_len():

    assert len(Path()) == 0
    assert len(Path('a', 'b', 'c')) == 3
    assert len(Path.from_text('1.2.3.4')) == 4

    assert len(Path(T)) == 0
    assert len(Path(T.a.b.c)) == 3
    assert len(Path(T.a()['b'].c.d)) == 5
Beispiel #2
0
def test_path_len():

    assert len(Path()) == 0
    assert len(Path('a', 'b', 'c')) == 3
    assert len(Path.from_text('1.2.3.4')) == 4

    assert len(Path(T)) == 0
    assert len(Path(T.a.b.c)) == 3
    assert len(Path(T.a()['b'].c.d)) == 5
Beispiel #3
0
def test_path_cache():
    assert Path.from_text('a.b.c') is Path.from_text('a.b.c')
    pre = Path._MAX_CACHE
    Path._MAX_CACHE = 0
    assert Path.from_text('d.e.f') is not Path.from_text('d.e.f')