2015-03-30 17:25:24 +00:00
|
|
|
package command
|
|
|
|
|
2015-04-01 02:21:02 +00:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/api"
|
|
|
|
)
|
|
|
|
|
2015-03-30 17:25:24 +00:00
|
|
|
const FixturePath = "./test-fixtures"
|
2015-04-01 02:21:02 +00:00
|
|
|
|
|
|
|
func testClient(t *testing.T, addr string, token string) *api.Client {
|
|
|
|
config := api.DefaultConfig()
|
|
|
|
config.Address = addr
|
|
|
|
client, err := api.NewClient(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
client.SetToken(token)
|
|
|
|
|
|
|
|
return client
|
|
|
|
}
|