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

Function TestRunEncrypt_Interactive_Success

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

Source from the content-addressed store, hash-verified

216}
217
218func TestRunEncrypt_Interactive_Success(t *testing.T) {
219 defer resetMocks()
220 setupTempConfig(t, configWithPasswordsYAML)
221
222 callCount := 0
223 readPasswordFn = func(_ string) ([]byte, error) {
224 callCount++
225 return []byte("testpassword123"), nil
226 }
227
228 runEncrypt()
229
230 configPath := config.DefaultConfigPath
231 data, err := os.ReadFile(configPath)
232 require.NoError(t, err)
233 content := string(data)
234 assert.Contains(t, content, "enc:")
235 assert.NotContains(t, content, "secret1")
236}
237
238// --- executeEncrypt error paths ---
239

Callers

nothing calls this directly

Calls 3

resetMocksFunction · 0.85
runEncryptFunction · 0.85
setupTempConfigFunction · 0.70

Tested by

no test coverage detected