MCPcopy
hub / github.com/hashicorp/memberlist / TestKeyring_GetPrimaryKey

Function TestKeyring_GetPrimaryKey

keyring_test.go:43–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func TestKeyring_GetPrimaryKey(t *testing.T) {
44 keyring, err := NewKeyring(TestKeys, TestKeys[1])
45 if err != nil {
46 t.Fatalf("err: %s", err)
47 }
48
49 // GetPrimaryKey returns correct key
50 primaryKey := keyring.GetPrimaryKey()
51 if !bytes.Equal(primaryKey, TestKeys[1]) {
52 t.Fatalf("Unexpected primary key: %v", primaryKey)
53 }
54}
55
56func TestKeyring_AddRemoveUse(t *testing.T) {
57 keyring, err := NewKeyring(nil, TestKeys[1])

Callers

nothing calls this directly

Calls 3

GetPrimaryKeyMethod · 0.95
NewKeyringFunction · 0.85
FatalfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…