- 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
16 lines
568 B
Python
16 lines
568 B
Python
from click.testing import CliRunner
|
|
from aitbc_cli.commands.wallet import wallet
|
|
import pathlib
|
|
import json
|
|
|
|
runner = CliRunner()
|
|
mock_wallet_dir = pathlib.Path("/tmp/test_wallet_dir_qwe")
|
|
mock_wallet_dir.mkdir(parents=True, exist_ok=True)
|
|
wallet_file = mock_wallet_dir / "test_wallet.json"
|
|
with open(wallet_file, "w") as f:
|
|
json.dump({"test": "data"}, f)
|
|
|
|
result = runner.invoke(wallet, ['delete', 'test_wallet', '--confirm'], obj={"wallet_dir": mock_wallet_dir, "output_format": "json"})
|
|
print(f"Exit code: {result.exit_code}")
|
|
print(f"Output: {result.output}")
|