mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
fix: unnecessary fmt.Sprintf in assertions
This commit is contained in:
parent
996e674ea7
commit
1cf663e2c1
@ -18,7 +18,6 @@ package apparmor
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
@ -71,9 +70,9 @@ func TestValidateValidHost(t *testing.T) {
|
|||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
err := v.Validate(getPodWithProfile(test.profile))
|
err := v.Validate(getPodWithProfile(test.profile))
|
||||||
if test.expectValid {
|
if test.expectValid {
|
||||||
assert.NoError(t, err, "Pod with profile %q should be valid", test.profile)
|
assert.NoErrorf(t, err, "Pod with profile %q should be valid", test.profile)
|
||||||
} else {
|
} else {
|
||||||
assert.Error(t, err, fmt.Sprintf("Pod with profile %q should trigger a validation error", test.profile))
|
assert.Errorf(t, err, "Pod with profile %q should trigger a validation error", test.profile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user