mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
21 lines
569 B
Python
21 lines
569 B
Python
import pathlib
|
|
from typing import List, Callable
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def make_files_structure(test_directory) -> Callable[[List[str]], List[pathlib.Path]]:
|
|
def create_files(paths: List[str]) -> List[pathlib.Path]:
|
|
files = []
|
|
for name in paths:
|
|
path = test_directory / name
|
|
if name.endswith('/'):
|
|
path.mkdir()
|
|
else:
|
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
path.touch()
|
|
files.append(path)
|
|
return files
|
|
|
|
return create_files
|