2019eab2c8
* Add SecureVariable mock * Add SecureVariableStub * Add SecureVariable Copy and Stub funcs
29 lines
548 B
Go
29 lines
548 B
Go
package nomad
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/nomad/nomad/mock"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestMockVariables(t *testing.T) {
|
|
defer mvs.Reset()
|
|
sv1 := mock.SecureVariable()
|
|
mvs.Add(sv1.Path, *sv1)
|
|
out := mvs.List("")
|
|
require.NotNil(t, out)
|
|
require.Len(t, out, 1)
|
|
}
|
|
|
|
func TestDeleteMockVariables(t *testing.T) {
|
|
defer mvs.Reset()
|
|
sv1 := mock.SecureVariable()
|
|
mvs.Add(sv1.Path, *sv1)
|
|
out := mvs.List("")
|
|
require.NotNil(t, out)
|
|
require.Len(t, out, 1)
|
|
mvs.Delete(sv1.Path)
|
|
require.Empty(t, mvs.List(""))
|
|
}
|