open-consul/command/agent/catalog_endpoint_test.go

24 lines
359 B
Go
Raw Normal View History

2013-12-23 22:26:34 +00:00
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)
}
}