mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Using assertions
Using assertions for unit tests: 1. cmd/kube-controller-manager/app/controller_manager_test.go 2. pkg/controller/bootstrap/jws_test.go 3. pkg/controller/cloud/node_controller_test.go 4. pkg/controller/controller_utils_test.go
This commit is contained in:
@@ -24,6 +24,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestIsControllerEnabled(t *testing.T) {
|
||||
@@ -73,9 +75,7 @@ func TestIsControllerEnabled(t *testing.T) {
|
||||
|
||||
for _, tc := range tcs {
|
||||
actual := IsControllerEnabled(tc.controllerName, sets.NewString(tc.disabledByDefaultControllers...), tc.controllers...)
|
||||
if actual != tc.expected {
|
||||
t.Errorf("%v: expected %v, got %v", tc.name, tc.expected, actual)
|
||||
}
|
||||
assert.Equal(t, tc.expected, actual, "%v: expected %v, got %v", tc.name, tc.expected, actual)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user