mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
Add context-aware functions to vault/api (#14388)
This commit is contained in:
committed by
GitHub
parent
fea828993c
commit
8234a663e7
@@ -1,6 +1,7 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -81,7 +82,7 @@ func TestDeleteCommand_Run(t *testing.T) {
|
||||
client, closer := testVaultServer(t)
|
||||
defer closer()
|
||||
|
||||
if _, err := client.Logical().Write("secret/delete/foo", map[string]interface{}{
|
||||
if _, err := client.Logical().WriteWithContext(context.Background(), "secret/delete/foo", map[string]interface{}{
|
||||
"foo": "bar",
|
||||
}); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -103,7 +104,7 @@ func TestDeleteCommand_Run(t *testing.T) {
|
||||
t.Errorf("expected %q to contain %q", combined, expected)
|
||||
}
|
||||
|
||||
secret, _ := client.Logical().Read("secret/delete/foo")
|
||||
secret, _ := client.Logical().ReadWithContext(context.Background(), "secret/delete/foo")
|
||||
if secret != nil {
|
||||
t.Errorf("expected deletion: %#v", secret)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user