28 lines
693 B
Python
28 lines
693 B
Python
"""Test CLI functionality."""
|
|
|
|
import pytest
|
|
from click.testing import CliRunner
|
|
from api_snapshot.cli import main
|
|
|
|
|
|
def test_main_command():
|
|
"""Test main command help."""
|
|
runner = CliRunner()
|
|
result = runner.invoke(main, ["--help"])
|
|
assert result.exit_code == 0
|
|
assert "API Snapshot" in result.output
|
|
|
|
|
|
def test_record_command_exists():
|
|
"""Test record command exists."""
|
|
runner = CliRunner()
|
|
result = runner.invoke(main, ["record", "--help"])
|
|
assert result.exit_code == 0
|
|
|
|
|
|
def test_serve_command_exists():
|
|
"""Test serve command exists."""
|
|
runner = CliRunner()
|
|
result = runner.invoke(main, ["serve", "--help"])
|
|
assert result.exit_code == 0
|