You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/command/agent/catalog_endpoint_test.go

24 lines
359 B

package agent
import (
"os"
"testing"
)
func TestCatalogDatacenters(t *testing.T) {
dir, srv := makeHTTPServer(t)
defer os.RemoveAll(dir)
defer srv.Shutdown()
defer srv.agent.Shutdown()
obj, err := srv.CatalogDatacenters(nil)
if err != nil {
t.Fatalf("err: %v", err)
}
dcs := obj.([]string)
if len(dcs) != 1 {
t.Fatalf("bad: %v", obj)
}
}