open-vault/command/auth_test.go
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

38 lines
622 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package command
import (
"testing"
"github.com/mitchellh/cli"
"github.com/hashicorp/vault/command/token"
)
func testAuthCommand(tb testing.TB) (*cli.MockUi, *AuthCommand) {
tb.Helper()
ui := cli.NewMockUi()
return ui, &AuthCommand{
BaseCommand: &BaseCommand{
UI: ui,
// Override to our own token helper
tokenHelper: token.NewTestingTokenHelper(),
},
}
}
func TestAuthCommand_Run(t *testing.T) {
t.Parallel()
t.Run("no_tabs", func(t *testing.T) {
t.Parallel()
_, cmd := testAuthCommand(t)
assertNoTabs(t, cmd)
})
}