mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Fix some commands test
This commit is contained in:
@@ -70,7 +70,7 @@ func TestAllocStatusCommand_Fails(t *testing.T) {
|
||||
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
|
||||
t.Fatalf("expected exit 1, got: %d", code)
|
||||
}
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
|
||||
t.Fatalf("expected getting formatter error, got: %s", out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func TestEvalStatusCommand_Fails(t *testing.T) {
|
||||
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
|
||||
t.Fatalf("expected exit 1, got: %d", code)
|
||||
}
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
|
||||
t.Fatalf("expected getting formatter error, got: %s", out)
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ func TestInspectCommand_Fails(t *testing.T) {
|
||||
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
|
||||
t.Fatalf("expected exit 1, got: %d", code)
|
||||
}
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
|
||||
t.Fatalf("expected getting formatter error, got: %s", out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestJobRevertCommand_Fails(t *testing.T) {
|
||||
}
|
||||
ui.ErrorWriter.Reset()
|
||||
|
||||
if code := cmd.Run([]string{"-address=nope", "foo"}); code != 1 {
|
||||
if code := cmd.Run([]string{"-address=nope", "foo", "1"}); code != 1 {
|
||||
t.Fatalf("expected exit code 1, got: %d", code)
|
||||
}
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Error listing jobs") {
|
||||
|
||||
@@ -206,7 +206,7 @@ func TestNodeStatusCommand_Fails(t *testing.T) {
|
||||
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
|
||||
t.Fatalf("expected exit 1, got: %d", code)
|
||||
}
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
|
||||
t.Fatalf("expected getting formatter error, got: %s", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user