-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_test.go
37 lines (28 loc) · 922 Bytes
/
api_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2021 - MinIO, Inc. All rights reserved.
// Use of this source code is governed by the AGPLv3
// license that can be found in the LICENSE file.
package kes_test
import (
"context"
"testing"
"github.com/minio/kes/kestest"
)
func TestClient_CreateKey(t *testing.T) {
var server = kestest.NewServer()
defer server.Close()
const KeyName = "my-key"
if err := server.Client().CreateKey(context.Background(), KeyName); err != nil {
t.Fatalf("Failed to create key %q: %v", KeyName, err)
}
}
func TestClient_DeleteKey(t *testing.T) {
var server = kestest.NewServer()
defer server.Close()
const KeyName = "my-key"
if err := server.Client().CreateKey(context.Background(), KeyName); err != nil {
t.Fatalf("Failed to create key %q: %v", KeyName, err)
}
if err := server.Client().DeleteKey(context.Background(), KeyName); err != nil {
t.Fatalf("Failed to delete key %q: %v", KeyName, err)
}
}