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:
Matthieu MOREL
2024-06-28 21:20:13 +02:00
parent 40225a788c
commit f014b754fb
54 changed files with 203 additions and 207 deletions

View File

@@ -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))
}