Initial upload: Devtoolbelt v1.0.0 - unified CLI toolkit for developers
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-02-01 21:45:52 +00:00
parent 87eca69baf
commit a41f794a42

57
tests/test_cli.py Normal file
View File

@@ -0,0 +1,57 @@
"""Tests for CLI module."""
import pytest
from click.testing import CliRunner
from devtoolbelt.cli import main
class TestCLI:
"""Tests for CLI commands."""
@pytest.fixture
def runner(self):
"""Create a CLI runner."""
return CliRunner()
def test_help(self, runner):
"""Test help command."""
result = runner.invoke(main, ['--help'])
assert result.exit_code == 0
assert 'Devtoolbelt' in result.output
def test_version(self, runner):
"""Test version command."""
result = runner.invoke(main, ['version'])
assert result.exit_code == 0
assert 'Devtoolbelt' in result.output
def test_db_help(self, runner):
"""Test database help."""
result = runner.invoke(main, ['database', '--help'])
assert result.exit_code == 0
assert 'database' in result.output.lower()
def test_api_help(self, runner):
"""Test API help."""
result = runner.invoke(main, ['api', '--help'])
assert result.exit_code == 0
assert 'API' in result.output
def test_utils_help(self, runner):
"""Test utils help."""
result = runner.invoke(main, ['utils', '--help'])
assert result.exit_code == 0
assert 'Common utility functions' in result.output
def test_db_list_empty(self, runner):
"""Test db list with no configured databases."""
result = runner.invoke(main, ['database', 'list'])
assert result.exit_code == 0
assert 'No databases configured' in result.output
def test_api_list_empty(self, runner):
"""Test api list with no configured endpoints."""
result = runner.invoke(main, ['api', 'list'])
assert result.exit_code == 0
assert 'No API endpoints configured' in result.output