From 76b79d03f22f8f83435b1581e3784235289c83f9 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 1 Feb 2026 16:20:37 +0000 Subject: [PATCH] Initial upload with CI/CD workflow --- tests/test_cli.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/test_cli.py diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..c339b8d --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,32 @@ +import pytest +from click.testing import CliRunner +from src.cli import main + + +@pytest.fixture +def runner(): + return CliRunner() + + +def test_cli_help(runner): + result = runner.invoke(main, ['--help']) + assert result.exit_code == 0 + assert 'LocalAPI Docs' in result.output + + +def test_cli_serve(runner, tmp_path, sample_spec): + result = runner.invoke(main, ['serve', str(sample_spec)]) + assert result.exit_code == 0 + + +def test_cli_generate(runner, tmp_path, sample_spec): + output = tmp_path / "output.html" + result = runner.invoke(main, ['generate', str(sample_spec), '-o', str(output)]) + assert result.exit_code == 0 + assert output.exists() + + +def test_cli_validate(runner, sample_spec): + result = runner.invoke(main, ['validate', str(sample_spec)]) + assert result.exit_code == 0 + assert 'valid' in result.output.lower()