26 lines
516 B
Go
26 lines
516 B
Go
package secret
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestVault(t *testing.T) {
|
|
testKey := os.Getenv("TEST_VAULT_KEY")
|
|
if testKey == "" {
|
|
t.Skip("TEST_VAULT_KEY not set, which should contain the path to a secret for testing")
|
|
return
|
|
}
|
|
testValue := os.Getenv("TEST_VAULT_VALUE")
|
|
if testValue == "" {
|
|
t.Skip("TEST_VAULT_VALUE not set, which should contain the secret value for testing")
|
|
return
|
|
}
|
|
|
|
p := Vault()
|
|
testProvider(t, p, testProviderCase{
|
|
Key: testKey,
|
|
Test: testEqualString(testValue),
|
|
})
|
|
}
|