(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func 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 | |
| 277 | func TestExecuteEncrypt_UpdateConfigError(t *testing.T) { |
| 278 | defer resetMocks() |
nothing calls this directly
no test coverage detected