Exemple #1
0
def test_normalize_splitted_path_slash_dot_dotdot():
    path = ['/', '.', '..']
    expected = ['/']
    found = gdpath.normalize_splitted_path(path)
    assert found == expected
Exemple #2
0
def test_normalize_splitted_path_basic():
    path = ['one', 'two', 'three']
    expected = path
    found = gdpath.normalize_splitted_path(path)
    assert found == expected
Exemple #3
0
def test_normalize_splitted_path_slash_multiple_parent():
    path = ['/', '..', '..', '..']
    expected = ['/']
    found = gdpath.normalize_splitted_path(path)
    assert found == expected
Exemple #4
0
def test_normalize_splitted_path_only_dots():
    path = ['.', '.', '.', '.', '.', '.']
    expected = ['']
    found = gdpath.normalize_splitted_path(path)
    assert found == expected
Exemple #5
0
def test_normalize_splitted_path_dotdot_removing_all_path():
    path = ['one', 'two', 'three', '..', '..', '..', '..']
    expected = ['..']
    found = gdpath.normalize_splitted_path(path)
    assert found == expected
Exemple #6
0
def test_normalize_splitted_path_preserve_initial_dotdot():
    path = ['..', 'one', '..', '..', 'two', '..', '..', 'three']
    expected = ['..', '..', '..', 'three']
    found = gdpath.normalize_splitted_path(path)
    assert found == expected
Exemple #7
0
def test_normalize_splitted_path_ignore_dotdot():
    path = ['one', 'two', '..', 'three']
    expected = ['one', 'three']
    found = gdpath.normalize_splitted_path(path)
    assert found == expected