"""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