def METHOD_NAME(self, path: str, base: str | None = None) -> None:
    if base is None:
        base = self.tempdir
    fullpath = os.path.join(base, path)
    os.makedirs(os.path.dirname(fullpath), exist_ok=True)
    if not path.endswith("/"):
        with open(fullpath, "w") as f:
            f.write("# test file")