github.com/diptanu/nomad@v0.5.7-0.20170516172507-d72e86cbe3d9/api/status_test.go (about) 1 package api 2 3 import ( 4 "testing" 5 ) 6 7 func TestStatus_Leader(t *testing.T) { 8 c, s := makeClient(t, nil, nil) 9 defer s.Stop() 10 status := c.Status() 11 12 // Query for leader status should return a result 13 out, err := status.Leader() 14 if err != nil { 15 t.Fatalf("err: %s", err) 16 } 17 if out == "" { 18 t.Fatalf("expected leader, got: %q", out) 19 } 20 }