(t *testing.T)
| 361 | |
| 362 | |
| 363 | func TestNewPasswordsCommand_RunReadPasswordFails(t *testing.T) { |
| 364 | if os.Getenv("TEST_PASSWORD_CMD") == "1" { |
| 365 | cmd := NewPasswordsCommand() |
| 366 | cmd.Run(cmd, []string{}) |
| 367 | return |
| 368 | } |
| 369 | subCmd := exec.Command(os.Args[0], "-test.run=TestNewPasswordsCommand_RunReadPasswordFails") |
| 370 | subCmd.Env = append(os.Environ(), "TEST_PASSWORD_CMD=1") |
| 371 | subCmd.Stdin = strings.NewReader("test\n") |
| 372 | output, err := subCmd.CombinedOutput() |
| 373 | assert.Error(t, err) |
| 374 | assert.Contains(t, string(output), "Failed to read password") |
| 375 | } |
| 376 | |
| 377 | func TestNewPasswordsCommand_StructureDetails(t *testing.T) { |
| 378 | cmd := NewPasswordsCommand() |
nothing calls this directly
no test coverage detected