test: update CLI blockchain command test to use block query instead of info
Some checks failed
CLI Tests / test-cli (push) Successful in 2m26s
Security Scanning / security-scan (push) Failing after 46s

Changed test from 'blockchain info' to 'blockchain block --number 1' and added
verification for "Block #1" in output. Also improved error output to include
stdout when stderr is empty.
This commit is contained in:
aitbc
2026-04-19 20:22:17 +02:00
parent 08b03d4bc0
commit 733fa11638

View File

@@ -54,12 +54,12 @@ def run_cli_test():
# Test 3: CLI blockchain command
print("\n3. Testing CLI blockchain command...")
try:
result = run_command("blockchain", "info")
result = run_command("blockchain", "block", "--number", "1")
if result.returncode == 0:
if result.returncode == 0 and "Block #1" in result.stdout:
print("✅ CLI blockchain command working")
else:
print(f"❌ CLI blockchain command failed: {result.stderr}")
print(f"❌ CLI blockchain command failed: {result.stderr or result.stdout}")
return False
except Exception as e:
print(f"❌ CLI blockchain command error: {e}")