mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 10:37:56 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			552 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			552 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 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)
 | |
| 	})
 | |
| }
 | 
