Skip to content

Commit

Permalink
Merge pull request #49603 from zhangxiaoyu-zidif/fix-errorf-for-get-test
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 49524, 46760, 50206, 50166, 49603)

Fix errorf for get test

**What this PR does / why we need it**:
If the error messages do not use format, use t.Error() will be fine.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue authored Aug 7, 2017
2 parents 4e2b905 + 142f142 commit 4217e10
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pkg/kubectl/cmd/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -265,7 +265,7 @@ func TestGetObjects(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -417,7 +417,7 @@ func TestGetSortedObjects(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -471,7 +471,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -500,7 +500,7 @@ func TestGetListObjects(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -542,7 +542,7 @@ func TestGetAllListObjects(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -571,7 +571,7 @@ func TestGetListComponentStatus(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -610,7 +610,7 @@ func TestGetMultipleTypeObjects(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -719,7 +719,7 @@ func TestGetMultipleTypeObjectsWithSelector(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -764,7 +764,7 @@ func TestGetMultipleTypeObjectsWithDirectReference(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand All @@ -789,7 +789,7 @@ func TestGetByFormatForcesFlag(t *testing.T) {

showAllFlag, _ := cmd.Flags().GetBool("show-all")
if showAllFlag {
t.Errorf("expected showAll to not be true when getting resource")
t.Error("expected showAll to not be true when getting resource")
}
}

Expand Down Expand Up @@ -909,7 +909,7 @@ func TestWatchSelector(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -951,7 +951,7 @@ func TestWatchResource(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -994,7 +994,7 @@ func TestWatchResourceIdentifiedByFile(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -1036,7 +1036,7 @@ func TestWatchOnlyResource(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down Expand Up @@ -1082,7 +1082,7 @@ func TestWatchOnlyList(t *testing.T) {
verifyObjects(t, expected, tf.Printer.(*testPrinter).Objects)

if len(buf.String()) == 0 {
t.Errorf("unexpected empty output")
t.Error("unexpected empty output")
}
}

Expand Down

0 comments on commit 4217e10

Please sign in to comment.