import pathlib
import shutil


def workdir(tmpdir):
    """Create a working directory with PatchSim test data files."""
    basedir = pathlib.Path(__file__).resolve().parents[1] / "manual_tests"

    for fname in basedir.glob("cfg_*"):
        shutil.copy(str(basedir / fname.name), str(tmpdir))

    for fname in basedir.glob("*.txt"):
        shutil.copy(str(basedir / fname.name), str(tmpdir))

    for fname in basedir.glob("*.out.expected"):
        shutil.copy(str(basedir / fname.name), str(tmpdir))

    return pathlib.Path(str(tmpdir))