MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestExecuteEncrypt_LoadConfigError

Function TestExecuteEncrypt_LoadConfigError

cmd/encrypt/encrypt_test.go:260–275  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func TestExecuteEncrypt_LoadConfigError(t *testing.T) {
261 defer resetMocks()
262
263 // Point to non-existent path
264 origConfigPath := config.DefaultConfigPath
265 config.DefaultConfigPath = "/nonexistent_dir/subdir/tryssh.db"
266 defer func() { config.DefaultConfigPath = origConfigPath }()
267
268 os.Setenv("TRYSSH_MASTER_KEY", "testpassword123")
269
270 var fatalMsg string
271 fatalFn = func(args ...interface{}) { fatalMsg = fmt.Sprint(args...) }
272
273 executeEncrypt()
274 assert.NotEmpty(t, fatalMsg)
275}
276
277func TestExecuteEncrypt_UpdateConfigError(t *testing.T) {
278 defer resetMocks()

Callers

nothing calls this directly

Calls 2

resetMocksFunction · 0.85
executeEncryptFunction · 0.85

Tested by

no test coverage detected