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

Function TestNewPasswordsCommand_RunReadPasswordFails

cmd/create/create_test.go:363–375  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

361
362
363func 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
377func TestNewPasswordsCommand_StructureDetails(t *testing.T) {
378 cmd := NewPasswordsCommand()

Callers

nothing calls this directly

Calls 1

NewPasswordsCommandFunction · 0.70

Tested by

no test coverage detected