- CLI with context detection, config merging, VM blocking - Command modules: dotfiles, packages, setup, remote, dev, projects - Zsh completion with declarative command/subcommand/flag structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
"""Tests for CLI."""
|
|
|
|
import subprocess
|
|
import sys
|
|
from unittest.mock import patch
|
|
|
|
import pytest
|
|
|
|
|
|
def test_version_flag():
|
|
"""Test --version flag works."""
|
|
result = subprocess.run(
|
|
[sys.executable, "-m", "flow", "--version"],
|
|
capture_output=True, text=True,
|
|
)
|
|
assert result.returncode == 0
|
|
assert "flow" in result.stdout
|
|
|
|
|
|
def test_help_flag():
|
|
"""Test --help shows commands."""
|
|
result = subprocess.run(
|
|
[sys.executable, "-m", "flow", "--help"],
|
|
capture_output=True, text=True,
|
|
)
|
|
assert result.returncode == 0
|
|
assert "dotfiles" in result.stdout
|
|
assert "packages" in result.stdout
|
|
assert "setup" in result.stdout
|
|
|
|
|
|
def test_dotfiles_help():
|
|
result = subprocess.run(
|
|
[sys.executable, "-m", "flow", "dotfiles", "--help"],
|
|
capture_output=True, text=True,
|
|
)
|
|
assert result.returncode == 0
|
|
assert "link" in result.stdout
|
|
assert "unlink" in result.stdout
|
|
|
|
|
|
def test_packages_help():
|
|
result = subprocess.run(
|
|
[sys.executable, "-m", "flow", "packages", "--help"],
|
|
capture_output=True, text=True,
|
|
)
|
|
assert result.returncode == 0
|
|
assert "install" in result.stdout
|