2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-11-02 17:57:35 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-03-15 12:42:43 +00:00
|
|
|
"github.com/hashicorp/nomad/ci"
|
2020-11-02 17:57:35 +00:00
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestEventCommand_BaseCommand(t *testing.T) {
|
2022-03-15 12:42:43 +00:00
|
|
|
ci.Parallel(t)
|
2020-11-02 17:57:35 +00:00
|
|
|
|
|
|
|
srv, _, url := testServer(t, false, nil)
|
|
|
|
defer srv.Shutdown()
|
|
|
|
|
|
|
|
ui := cli.NewMockUi()
|
|
|
|
cmd := &EventCommand{Meta: Meta{Ui: ui}}
|
|
|
|
|
|
|
|
code := cmd.Run([]string{"-address=" + url})
|
|
|
|
|
|
|
|
require.Equal(t, -18511, code)
|
|
|
|
}
|