Initial import of cf-temp-email deploy CLI
This commit is contained in:
19
tests/test_subprocess_runner.py
Normal file
19
tests/test_subprocess_runner.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from cf_temp_email_deploy.errors import CommandExecutionError
|
||||
from cf_temp_email_deploy.subprocess_runner import CommandRunner, CommandSpec
|
||||
|
||||
|
||||
def test_command_runner_captures_stdout() -> None:
|
||||
runner = CommandRunner()
|
||||
result = runner.run_checked(CommandSpec(args=("python3", "-c", "print('ok')")))
|
||||
assert result.stdout.strip() == "ok"
|
||||
|
||||
|
||||
def test_command_runner_raises_for_non_zero_exit() -> None:
|
||||
runner = CommandRunner()
|
||||
with pytest.raises(CommandExecutionError):
|
||||
runner.run_checked(CommandSpec(args=("python3", "-c", "raise SystemExit(3)")))
|
||||
|
||||
Reference in New Issue
Block a user