def test_normalize_splitted_path_slash_dot_dotdot(): path = ['/', '.', '..'] expected = ['/'] found = gdpath.normalize_splitted_path(path) assert found == expected
def test_normalize_splitted_path_basic(): path = ['one', 'two', 'three'] expected = path found = gdpath.normalize_splitted_path(path) assert found == expected
def test_normalize_splitted_path_slash_multiple_parent(): path = ['/', '..', '..', '..'] expected = ['/'] found = gdpath.normalize_splitted_path(path) assert found == expected
def test_normalize_splitted_path_only_dots(): path = ['.', '.', '.', '.', '.', '.'] expected = [''] found = gdpath.normalize_splitted_path(path) assert found == expected
def test_normalize_splitted_path_dotdot_removing_all_path(): path = ['one', 'two', 'three', '..', '..', '..', '..'] expected = ['..'] found = gdpath.normalize_splitted_path(path) assert found == expected
def test_normalize_splitted_path_preserve_initial_dotdot(): path = ['..', 'one', '..', '..', 'two', '..', '..', 'three'] expected = ['..', '..', '..', 'three'] found = gdpath.normalize_splitted_path(path) assert found == expected
def test_normalize_splitted_path_ignore_dotdot(): path = ['one', 'two', '..', 'three'] expected = ['one', 'three'] found = gdpath.normalize_splitted_path(path) assert found == expected