fix: remove /v1 prefix from agent API endpoints and resolve variable naming conflicts

- Update all agent command endpoints to remove /v1 prefix for API consistency
- Rename `success` variable to `is_success` in chain.py to avoid conflict with success() function
- Rename `output` parameter to `output_file` in genesis.py for clarity
- Add admin command help tests to verify command structure
- Update blockchain status endpoint from /status to /v1/health in tests
- Mark admin help command as working
This commit is contained in:
oib
2026-03-05 09:13:11 +01:00
parent d0fc3174f3
commit 5273b1866f
13 changed files with 587 additions and 29 deletions

View File

@@ -25,6 +25,27 @@ def mock_config():
class TestAdminCommands:
"""Test admin command group"""
def test_admin_help(self, runner):
"""Test admin command help output"""
result = runner.invoke(admin, ['--help'])
assert result.exit_code == 0
assert 'System administration commands' in result.output
assert 'status' in result.output
assert 'jobs' in result.output
assert 'miners' in result.output
assert 'maintenance' in result.output
def test_admin_no_args(self, runner):
"""Test admin command with no args shows help"""
result = runner.invoke(admin)
# Click returns exit code 2 when a required command is missing but still prints help for groups
assert result.exit_code == 2
assert 'System administration commands' in result.output
assert 'status' in result.output
assert 'jobs' in result.output
@patch('aitbc_cli.commands.admin.httpx.Client')
def test_status_success(self, mock_client_class, runner, mock_config):
"""Test successful system status check"""