open-consul/api/status_test.go
2015-01-16 10:56:47 -08:00

36 lines
505 B
Go

package api
import (
"testing"
)
func TestStatusLeader(t *testing.T) {
c, s := makeClient(t)
defer s.stop()
status := c.Status()
leader, err := status.Leader()
if err != nil {
t.Fatalf("err: %v", err)
}
if leader == "" {
t.Fatalf("Expected leader")
}
}
func TestStatusPeers(t *testing.T) {
c, s := makeClient(t)
defer s.stop()
status := c.Status()
peers, err := status.Peers()
if err != nil {
t.Fatalf("err: %v", err)
}
if len(peers) == 0 {
t.Fatalf("Expected peers ")
}
}