-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathjob_queue_test.go
More file actions
41 lines (33 loc) · 837 Bytes
/
job_queue_test.go
File metadata and controls
41 lines (33 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright IBM Corp. 2015, 2026
// SPDX-License-Identifier: BUSL-1.1
package command
import (
"testing"
"github.com/hashicorp/cli"
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/ci"
"github.com/shoenig/test/must"
)
func TestJobQueue_Implements(t *testing.T) {
ci.Parallel(t)
var _ cli.Command = &JobQueueCommand{}
}
func TestJobQueue_printOutput(t *testing.T) {
ci.Parallel(t)
ui := cli.NewMockUi()
cmd := &JobQueueCommand{Meta: Meta{Ui: ui}}
testResp := &api.BatchQueueStatusResponse{
Workloads: []api.Workload{
{
JobID: "123",
Tenant: "testTenant1",
Priority: 5,
},
},
}
cmd.printOutput(testResp)
expect := "JobID | Tenant | Priority\n" +
"------+-------------+---------\n" +
"123 | testTenant1 | 5\n\n"
must.Eq(t, expect, ui.OutputWriter.String())
}