MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestLoadOrGenNodeKey

Function TestLoadOrGenNodeKey

p2p/key_test.go:16–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestLoadOrGenNodeKey(t *testing.T) {
17 filePath := filepath.Join(os.TempDir(), tmrand.Str(12)+"_peer_id.json")
18
19 nodeKey, err := LoadOrGenNodeKey(filePath)
20 assert.Nil(t, err)
21
22 nodeKey2, err := LoadOrGenNodeKey(filePath)
23 assert.Nil(t, err)
24
25 assert.Equal(t, nodeKey, nodeKey2)
26}
27
28func TestLoadNodeKey(t *testing.T) {
29 filePath := filepath.Join(os.TempDir(), tmrand.Str(12)+"_peer_id.json")

Callers

nothing calls this directly

Calls 3

LoadOrGenNodeKeyFunction · 0.85
StrMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected