fix: enable empty and len rules from testifylint on pkg package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
@@ -86,7 +86,7 @@ func TestPatchNode(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
actions := fakeClient.Actions()
|
||||
assert.Equal(t, 1, len(actions), "unexpected actions: %#v", actions)
|
||||
assert.Len(t, actions, 1, "unexpected actions: %#v", actions)
|
||||
patchAction := actions[0].(core.PatchActionImpl)
|
||||
assert.Equal(t, testCase.patch, string(patchAction.Patch), "%d: unexpected patch: %s", i, string(patchAction.Patch))
|
||||
}
|
||||
@@ -145,9 +145,9 @@ func TestUpdateNodeIfNeeded(t *testing.T) {
|
||||
}
|
||||
actions := fakeClient.Actions()
|
||||
if testCase.patch == "" {
|
||||
assert.Equal(t, 0, len(actions), "unexpected actions: %#v", actions)
|
||||
assert.Empty(t, actions, "unexpected actions")
|
||||
} else {
|
||||
assert.Equal(t, 1, len(actions), "unexpected actions: %#v", actions)
|
||||
assert.Len(t, actions, 1, "unexpected actions: %#v", actions)
|
||||
patchAction := actions[0].(core.PatchActionImpl)
|
||||
assert.Equal(t, testCase.patch, string(patchAction.Patch), "%d: unexpected patch: %s", i, string(patchAction.Patch))
|
||||
}
|
||||
|
Reference in New Issue
Block a user