From f95bc9289d684d311c54ff66adc2dd50a4af8143 Mon Sep 17 00:00:00 2001 From: Cao Shufeng Date: Sun, 4 Feb 2018 15:14:55 +0800 Subject: [PATCH] fix assert.Equal argument order Reference: https://godoc.org/github.com/stretchr/testify/assert#Equal --- pkg/kubelet/dockershim/helpers_test.go | 2 +- .../pkg/admission/security/podsecuritypolicy/admission_test.go | 2 +- staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kubelet/dockershim/helpers_test.go b/pkg/kubelet/dockershim/helpers_test.go index 03809c4c5f..65c97ccd23 100644 --- a/pkg/kubelet/dockershim/helpers_test.go +++ b/pkg/kubelet/dockershim/helpers_test.go @@ -342,5 +342,5 @@ func TestGenerateMountBindings(t *testing.T) { } result := generateMountBindings(mounts) - assert.Equal(t, result, expectedResult) + assert.Equal(t, expectedResult, result) } diff --git a/plugin/pkg/admission/security/podsecuritypolicy/admission_test.go b/plugin/pkg/admission/security/podsecuritypolicy/admission_test.go index 48febd8976..8b9f300319 100644 --- a/plugin/pkg/admission/security/podsecuritypolicy/admission_test.go +++ b/plugin/pkg/admission/security/podsecuritypolicy/admission_test.go @@ -2309,7 +2309,7 @@ func TestPreferValidatedPSP(t *testing.T) { _, pspName, validationErrs, err := plugin.computeSecurityContext(attrs, pod, false, tc.validatedPSPHint) assert.NoError(t, err) assert.Len(t, validationErrs, tc.expectValidationErrs) - assert.Equal(t, pspName, tc.expectedPSP) + assert.Equal(t, tc.expectedPSP, pspName) }) } } diff --git a/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go b/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go index 231b836c09..31a4c079d8 100644 --- a/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go +++ b/staging/src/k8s.io/client-go/util/buffer/ring_growing_test.go @@ -39,7 +39,7 @@ func TestGrowth(t *testing.T) { } assert.Equalf(t, x, read, "expected to have read %d items: %d", x, read) assert.Zerof(t, g.readable, "expected readable to be zero: %d", g.readable) - assert.Equalf(t, g.n, 16, "expected N to be 16: %d", g.n) + assert.Equalf(t, 16, g.n, "expected N to be 16: %d", g.n) } func TestEmpty(t *testing.T) {