conductor(checkpoint): Checkpoint end of Phase 3
This commit is contained in:
31
scripts/cluster_status/tests/test_formatter.py
Normal file
31
scripts/cluster_status/tests/test_formatter.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import pytest
|
||||
import output_formatter
|
||||
|
||||
def test_format_cluster_summary():
|
||||
"""Test the summary string generation."""
|
||||
cluster_data = {
|
||||
"health": "Healthy",
|
||||
"primary_count": 1,
|
||||
"nodes": []
|
||||
}
|
||||
summary = output_formatter.format_summary(cluster_data)
|
||||
assert "Healthy" in summary
|
||||
assert "Primaries" in summary
|
||||
assert "1" in summary
|
||||
|
||||
def test_format_node_table():
|
||||
"""Test the table generation."""
|
||||
nodes = [
|
||||
{
|
||||
"node": "node1",
|
||||
"role": "primary",
|
||||
"status": "passing",
|
||||
"uptime": 100,
|
||||
"replication_lag": "N/A",
|
||||
"litefs_primary": True
|
||||
}
|
||||
]
|
||||
table = output_formatter.format_node_table(nodes, use_color=False)
|
||||
assert "node1" in table
|
||||
assert "primary" in table
|
||||
assert "passing" in table
|
||||
Reference in New Issue
Block a user