vault/command/auth_test.go

37 lines
622 B
Go
Raw Normal View History

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