Unmux output dir generation

This commit is contained in:
Javanaut
2026-06-19 08:19:43 +02:00
parent 176cfa06eb
commit 8a375ccce1
3 changed files with 126 additions and 8 deletions

View File

@@ -35,7 +35,13 @@ if pytest is not None:
SRC_ROOT = Path(__file__).resolve().parents[2] / "src"
def run_ffx_unmux(workdir: Path, home_dir: Path, database_path: Path, *args: str) -> subprocess.CompletedProcess[str]:
def run_ffx_unmux(
workdir: Path,
home_dir: Path,
database_path: Path,
*args: str,
input_text: str | None = None,
) -> subprocess.CompletedProcess[str]:
env = os.environ.copy()
env["HOME"] = str(home_dir)
existing_pythonpath = env.get("PYTHONPATH", "")
@@ -50,7 +56,14 @@ def run_ffx_unmux(workdir: Path, home_dir: Path, database_path: Path, *args: str
"unmux",
*args,
]
return subprocess.run(command, cwd=workdir, env=env, capture_output=True, text=True)
return subprocess.run(
command,
cwd=workdir,
env=env,
capture_output=True,
input=input_text,
text=True,
)
class UnmuxCliTests(unittest.TestCase):
@@ -164,6 +177,7 @@ class UnmuxCliTests(unittest.TestCase):
"--label",
"dball",
str(source_path),
input_text="y\n",
)
self.assertCompleted(completed)