File indexing completed on 2026-04-27 07:28:14
0001 """Tests for aid2e.cli CLI functionality."""
0002
0003 import pytest
0004 from click.testing import CliRunner
0005 from aid2e.cli.aid2e_cli import cli
0006
0007
0008 @pytest.fixture
0009 def runner():
0010 """Create a CLI test runner."""
0011 return CliRunner()
0012
0013
0014 def test_cli_help(runner):
0015 """Test CLI help command."""
0016 result = runner.invoke(cli, ['--help'])
0017 assert result.exit_code == 0
0018 assert 'AID2E' in result.output
0019 assert 'Usage:' in result.output
0020
0021
0022 def test_cli_version(runner):
0023 """Test CLI version command."""
0024 result = runner.invoke(cli, ['--version'])
0025 assert result.exit_code == 0
0026 assert 'version' in result.output.lower()
0027
0028
0029 def test_cli_version_subcommand(runner):
0030 """Test CLI version subcommand."""
0031 result = runner.invoke(cli, ['version'])
0032 assert result.exit_code == 0
0033
0034
0035 def test_cli_info_command_exists(runner):
0036 """Test that info command exists."""
0037 result = runner.invoke(cli, ['--help'])
0038 assert 'info' in result.output
0039
0040
0041 def test_cli_load_command_exists(runner):
0042 """Test that load command exists."""
0043 result = runner.invoke(cli, ['--help'])
0044 assert 'load' in result.output