tmux-amq/tests/test_makefile.py

36 lines
1.1 KiB
Python
Raw Normal View History

import subprocess
from pathlib import Path
def test_plain_make_lists_available_targets():
project = Path(__file__).resolve().parents[1]
result = subprocess.run(
["make", "--no-print-directory"],
cwd=project,
text=True,
capture_output=True,
check=True,
)
assert result.stdout.splitlines() == [
" help List available targets",
" install Install or refresh tamq as a user-level uv tool",
" uninstall Uninstall the user-level tamq tool",
" cleanup Stop tamq and remove tamq-owned runtime files (preserves history)",
" test Run the test suite",
" check Run tests and repository consistency checks",
]
def test_cleanup_target_requires_confirmed_tamq_cleanup_without_running_it():
project = Path(__file__).resolve().parents[1]
result = subprocess.run(
["make", "--no-print-directory", "-n", "cleanup"],
cwd=project,
text=True,
capture_output=True,
check=True,
)
assert result.stdout.strip() == "uv run tamq cleanup --yes"