Ejemplo n.º 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,
    )
Ejemplo n.º 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,
    )
Ejemplo n.º 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,
    )
Ejemplo n.º 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,
    )
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 7
0
def _split_apply(v, key=None):
    if key is not None:
        v = key(v)
    return utils.path_splitter(str(v))
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)