Exemple #1
0
def test_path_splitter_splits_path_string_by_separator_and_removes_extension(x):
    z = py23_str(pathlib.Path(*x[:-2])) + "." + x[-1]
    y = tuple(pathlib.Path(z).parts)
    assert tuple(utils.path_splitter(z)) == y[:-1] + (
        pathlib.Path(z).stem,
        pathlib.Path(z).suffix,
    )
Exemple #2
0
def test_path_splitter_splits_path_string_by_separator_and_removes_extension(x):
    z = str(pathlib.Path(*x[:-2])) + "." + x[-1]
    y = tuple(pathlib.Path(z).parts)
    assert tuple(utils.path_splitter(z)) == y[:-1] + (
        pathlib.Path(z).stem,
        pathlib.Path(z).suffix,
    )
Exemple #3
0
def test_path_splitter_splits_path_string_by_separator_and_removes_extension_example():
    z = "/this/is/a/path/file.exe"
    y = tuple(pathlib.Path(z).parts)
    assert tuple(utils.path_splitter(z)) == y[:-1] + (
        pathlib.Path(z).stem,
        pathlib.Path(z).suffix,
    )
Exemple #4
0
def test_path_splitter_splits_path_string_by_separator_and_removes_extension_example(
):
    z = "/this/is/a/path/file.exe"
    y = tuple(pathlib.Path(z).parts)
    assert tuple(utils.path_splitter(z)) == y[:-1] + (
        pathlib.Path(z).stem,
        pathlib.Path(z).suffix,
    )
Exemple #5
0
def test_path_splitter_splits_path_string_by_separator(x):
    z = py23_str(pathlib.Path(*x))
    assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)
Exemple #6
0
def test_path_splitter_splits_path_string_by_separator_example():
    z = "/this/is/a/path"
    assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)
    z = pathlib.Path("/this/is/a/path")
    assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)
def _split_apply(v, key=None):
    if key is not None:
        v = key(v)
    return utils.path_splitter(str(v))
Exemple #8
0
def test_path_splitter_splits_path_string_by_separator_and_removes_extension_example():
    given = "/this/is/a/path/file.x1.10.tar.gz"
    expected = (os.sep, "this", "is", "a", "path", "file.x1.10", ".tar", ".gz")
    assert tuple(utils.path_splitter(given)) == tuple(expected)
Exemple #9
0
def test_path_splitter_splits_path_string_by_separator_example():
    given = "/this/is/a/path"
    expected = (os.sep, "this", "is", "a", "path")
    assert tuple(utils.path_splitter(given)) == tuple(expected)
    given = pathlib.Path(given)
    assert tuple(utils.path_splitter(given)) == tuple(expected)
Exemple #10
0
def test_path_splitter_splits_path_string_by_separator(x):
    z = py23_str(pathlib.Path(*x))
    assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)
Exemple #11
0
def test_path_splitter_splits_path_string_by_separator_example():
    z = "/this/is/a/path"
    assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)
    z = pathlib.Path("/this/is/a/path")
    assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)