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, )
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, )
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, )
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, )
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)
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))
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)
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)
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)
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)