(t *testing.T)
| 198 | } |
| 199 | |
| 200 | func TestRunEncrypt_Interactive_ConfirmReadError(t *testing.T) { |
| 201 | defer resetMocks() |
| 202 | |
| 203 | callCount := 0 |
| 204 | var fatalMsg string |
| 205 | fatalFn = func(args ...interface{}) { fatalMsg = fmt.Sprint(args...) } |
| 206 | readPasswordFn = func(_ string) ([]byte, error) { |
| 207 | callCount++ |
| 208 | if callCount == 1 { |
| 209 | return []byte("password1"), nil |
| 210 | } |
| 211 | return nil, errors.New("confirm error") |
| 212 | } |
| 213 | |
| 214 | runEncrypt() |
| 215 | assert.Contains(t, fatalMsg, "Failed to read password") |
| 216 | } |
| 217 | |
| 218 | func TestRunEncrypt_Interactive_Success(t *testing.T) { |
| 219 | defer resetMocks() |
nothing calls this directly
no test coverage detected