github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/command/var_test.go (about)

     1  package command
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/nomad/api"
     7  	"github.com/hashicorp/nomad/command/agent"
     8  )
     9  
    10  // testVariable returns a test variable spec
    11  func testVariable() *api.Variable {
    12  	return &api.Variable{
    13  		Namespace: "default",
    14  		Path:      "test/var",
    15  		Items: map[string]string{
    16  			"keyA": "valueA",
    17  			"keyB": "valueB",
    18  		},
    19  	}
    20  }
    21  
    22  func testAPIClient(t *testing.T) (srv *agent.TestAgent, client *api.Client, url string, shutdownFn func() error) {
    23  	srv, client, url = testServer(t, true, nil)
    24  	shutdownFn = srv.Shutdown
    25  	return
    26  }