open-nomad/command/util_test.go

23 lines
480 B
Go
Raw Normal View History

2015-09-11 18:10:20 +00:00
package command
import (
"testing"
2015-09-12 21:50:05 +00:00
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/testutil"
2015-09-11 18:10:20 +00:00
)
func testServer(t *testing.T) (*testutil.TestServer, *api.Client, string) {
// Make a new test server
srv := testutil.NewTestServer(t, nil)
2015-09-12 21:50:05 +00:00
// Make a client
clientConf := api.DefaultConfig()
clientConf.URL = "http://" + srv.HTTPAddr
2015-09-12 21:50:05 +00:00
client, err := api.NewClient(clientConf)
if err != nil {
t.Fatalf("err: %s", err)
}
return srv, client, clientConf.URL
2015-09-11 18:10:20 +00:00
}