open-vault/command/auth_test.go

35 lines
552 B
Go
Raw Normal View History

2015-03-29 23:42:45 +00:00
package command
import (
"testing"
2017-09-05 03:59:24 +00:00
"github.com/mitchellh/cli"
2017-09-05 03:59:24 +00:00
"github.com/hashicorp/vault/command/token"
2015-03-29 23:42:45 +00:00
)
2017-09-05 03:59:24 +00:00
func testAuthCommand(tb testing.TB) (*cli.MockUi, *AuthCommand) {
tb.Helper()
2015-03-30 17:55:41 +00:00
2017-09-05 03:59:24 +00:00
ui := cli.NewMockUi()
return ui, &AuthCommand{
BaseCommand: &BaseCommand{
UI: ui,
2015-03-30 17:55:41 +00:00
2017-09-05 03:59:24 +00:00
// Override to our own token helper
tokenHelper: token.NewTestingTokenHelper(),
},
}
2017-09-05 03:59:24 +00:00
}
2017-09-05 03:59:24 +00:00
func TestAuthCommand_Run(t *testing.T) {
t.Parallel()
t.Run("no_tabs", func(t *testing.T) {
t.Parallel()
2015-04-06 16:40:47 +00:00
2017-09-05 03:59:24 +00:00
_, cmd := testAuthCommand(t)
assertNoTabs(t, cmd)
})
2015-04-06 16:40:47 +00:00
}