Skip to content

Commit cb76b7d

Browse files
authored
Merge pull request #38 from JoshVanL/mod-remove-testify
Replace use of testify in manager/util in favour of stdlib
2 parents d0a56c9 + 14d0832 commit cb76b7d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require (
77
github.com/container-storage-interface/spec v1.6.0
88
github.com/go-logr/logr v1.2.3
99
github.com/kubernetes-csi/csi-lib-utils v0.11.0
10-
github.com/stretchr/testify v1.7.0
1110
golang.org/x/net v0.0.0-20220615171555-694bf12d69de
1211
google.golang.org/grpc v1.47.0
1312
k8s.io/apimachinery v0.23.4
@@ -30,7 +29,6 @@ require (
3029
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3130
github.com/modern-go/reflect2 v1.0.2 // indirect
3231
github.com/pkg/errors v0.9.1 // indirect
33-
github.com/pmezard/go-difflib v1.0.0 // indirect
3432
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
3533
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
3634
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect

manager/util/tokenrequest_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ limitations under the License.
1717
package util
1818

1919
import (
20+
"reflect"
2021
"testing"
2122
"time"
2223

2324
"k8s.io/client-go/rest"
2425

2526
"github.com/cert-manager/csi-lib/metadata"
26-
"github.com/stretchr/testify/assert"
2727
)
2828

2929
func Test_restConfigForMetadataTokenRequestEmptyAud(t *testing.T) {
@@ -131,8 +131,12 @@ func Test_restConfigForMetadataTokenRequestEmptyAud(t *testing.T) {
131131
for name, test := range tests {
132132
t.Run(name, func(t *testing.T) {
133133
restConfig, gotErr := restConfigForMetadataTokenRequestEmptyAud(baseRestConfig)(metadata.Metadata{VolumeContext: test.volumeContext})
134-
assert.Equal(t, test.expErr, gotErr != nil, "%v", gotErr)
135-
assert.Equal(t, test.expRestConfig, restConfig)
134+
if test.expErr != (gotErr != nil) {
135+
t.Errorf("expected error %t but got %v", test.expErr, gotErr)
136+
}
137+
if !reflect.DeepEqual(test.expRestConfig, restConfig) {
138+
t.Errorf("expected rest config %v but got %v", test.expRestConfig, restConfig)
139+
}
136140
})
137141
}
138142
}

0 commit comments

Comments
 (0)