-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplugin_test.go
More file actions
56 lines (42 loc) · 897 Bytes
/
Copy pathplugin_test.go
File metadata and controls
56 lines (42 loc) · 897 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package boltdb
import (
"log/slog"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
)
type testLog struct{}
func (tl *testLog) NamedLogger(string) *slog.Logger {
return slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug}))
}
func TestPluginInit(t *testing.T) {
p := Plugin{}
require.NoError(t, p.Init(&testLog{}, &Cfg{}))
}
func TestPluginName(t *testing.T) {
p := Plugin{}
require.Equal(t, "boltdb", p.Name())
}
type Cfg struct{}
func (c *Cfg) UnmarshalKey(string, any) error {
return nil
}
func (c *Cfg) Unmarshal(any) error {
return nil
}
func (c *Cfg) Get(string) any {
return nil
}
func (c *Cfg) Overwrite(map[string]any) error {
return nil
}
func (c *Cfg) Has(string) bool {
return false
}
func (c *Cfg) GracefulTimeout() time.Duration {
return time.Duration(0)
}
func (c *Cfg) RRVersion() string {
return "2.7.0"
}