(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func TestLoadNodeKey(t *testing.T) { |
| 29 | filePath := filepath.Join(os.TempDir(), tmrand.Str(12)+"_peer_id.json") |
| 30 | |
| 31 | _, err := LoadNodeKey(filePath) |
| 32 | assert.True(t, os.IsNotExist(err)) |
| 33 | |
| 34 | _, err = LoadOrGenNodeKey(filePath) |
| 35 | require.NoError(t, err) |
| 36 | |
| 37 | nodeKey, err := LoadNodeKey(filePath) |
| 38 | assert.NoError(t, err) |
| 39 | assert.NotNil(t, nodeKey) |
| 40 | } |
| 41 | |
| 42 | func TestNodeKeySaveAs(t *testing.T) { |
| 43 | filePath := filepath.Join(os.TempDir(), tmrand.Str(12)+"_peer_id.json") |
nothing calls this directly
no test coverage detected