Files
flow/tests/test_cli.py
Tomas Mirchev 6ea23e02df feat: add CLI entry point, command modules, and zsh completion
- 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>
2026-03-16 05:06:31 +02:00

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