test: update CLI blockchain command test to use block query instead of info
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:
@@ -54,12 +54,12 @@ def run_cli_test():
|
|||||||
# Test 3: CLI blockchain command
|
# Test 3: CLI blockchain command
|
||||||
print("\n3. Testing CLI blockchain command...")
|
print("\n3. Testing CLI blockchain command...")
|
||||||
try:
|
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")
|
print("✅ CLI blockchain command working")
|
||||||
else:
|
else:
|
||||||
print(f"❌ CLI blockchain command failed: {result.stderr}")
|
print(f"❌ CLI blockchain command failed: {result.stderr or result.stdout}")
|
||||||
return False
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"❌ CLI blockchain command error: {e}")
|
print(f"❌ CLI blockchain command error: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user