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

Function TestRunEncrypt_Interactive_ReadError

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

Source from the content-addressed store, hash-verified

187}
188
189func TestRunEncrypt_Interactive_ReadError(t *testing.T) {
190 defer resetMocks()
191
192 var fatalMsg string
193 fatalFn = func(args ...interface{}) { fatalMsg = fmt.Sprint(args...) }
194 readPasswordFn = func(_ string) ([]byte, error) { return nil, errors.New("read error") }
195
196 runEncrypt()
197 assert.Contains(t, fatalMsg, "Failed to read password")
198}
199
200func TestRunEncrypt_Interactive_ConfirmReadError(t *testing.T) {
201 defer resetMocks()

Callers

nothing calls this directly

Calls 2

resetMocksFunction · 0.85
runEncryptFunction · 0.85

Tested by

no test coverage detected