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

Function TestRunEncrypt_Interactive_PasswordMismatch

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

Source from the content-addressed store, hash-verified

169}
170
171func TestRunEncrypt_Interactive_PasswordMismatch(t *testing.T) {
172 defer resetMocks()
173
174 callCount := 0
175 var fatalMsg string
176 fatalFn = func(args ...interface{}) { fatalMsg = fmt.Sprint(args...) }
177 readPasswordFn = func(_ string) ([]byte, error) {
178 callCount++
179 if callCount == 1 {
180 return []byte("password1"), nil
181 }
182 return []byte("password2"), nil
183 }
184
185 runEncrypt()
186 assert.Contains(t, fatalMsg, "do not match")
187}
188
189func TestRunEncrypt_Interactive_ReadError(t *testing.T) {
190 defer resetMocks()

Callers

nothing calls this directly

Calls 2

resetMocksFunction · 0.85
runEncryptFunction · 0.85

Tested by

no test coverage detected