File: persist_test.go

package info (click to toggle)
golang-github-cloudflare-redoctober 0.0~git20161017.0.78e9720-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 636 kB
  • sloc: sh: 65; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 503 bytes parent folder | download | duplicates (3)
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
package persist

import (
	"testing"

	"github.com/cloudflare/redoctober/config"
)

func TestNew(t *testing.T) {
	cfg := &config.Delegations{
		Persist:   true,
		Policy:    "policy",
		Users:     []string{"alice"},
		Mechanism: FileMechanism,
		Location:  "testdata/store.bin",
	}

	store, err := New(cfg)
	if err != nil {
		t.Fatalf("persist: failed to create a new store: %s", err)
	}

	if _, ok := store.(*File); !ok {
		t.Fatalf("persist: New should return a *File, but returned a %T", store)
	}
}