Skip to content

Commit

Permalink
context.TODO->gomock.Any()
Browse files Browse the repository at this point in the history
Signed-off-by: alice-px <[email protected]>
  • Loading branch information
alicelyy committed Jan 22, 2024
1 parent bc94ee9 commit 314caae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/server/sdk/server_interceptors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestAuthorizationServerInterceptorCreateVolume(t *testing.T) {
gomock.InOrder(
s.MockDriver().
EXPECT().
Inspect(context.TODO(), []string{name}).
Inspect(gomock.Any(), []string{name}).
Return(nil, fmt.Errorf("not found")).
AnyTimes(),
s.MockDriver().
Expand Down
10 changes: 5 additions & 5 deletions csi/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ func TestNodePublishVolumeEphemeralEnabled(t *testing.T) {
Times(1),
s.MockDriver().
EXPECT().
Inspect(context.TODO(), []string{name}).
Inspect(gomock.Any(), []string{name}).
Return(nil, fmt.Errorf("not found")).
Times(1),
s.MockDriver().
Expand Down Expand Up @@ -1082,7 +1082,7 @@ func TestNodeGetVolumeStats(t *testing.T) {
gomock.InOrder(
s.MockDriver().
EXPECT().
Inspect(context.TODO(), []string{id}).
Inspect(gomock.Any(), []string{id}).
Return([]*api.Volume{
vol,
}, nil).
Expand Down Expand Up @@ -1153,7 +1153,7 @@ func TestNodeGetVolumeStats_NotFound(t *testing.T) {
gomock.InOrder(
s.MockDriver().
EXPECT().
Inspect(context.TODO(), []string{id}).
Inspect(gomock.Any(), []string{id}).
Return([]*api.Volume{}, nil).
Times(1),
)
Expand All @@ -1169,7 +1169,7 @@ func TestNodeGetVolumeStats_NotFound(t *testing.T) {
gomock.InOrder(
s.MockDriver().
EXPECT().
Inspect(context.TODO(), []string{id}).
Inspect(gomock.Any(), []string{id}).
Return([]*api.Volume{}, kvdb.ErrNotFound).
Times(1),
)
Expand All @@ -1185,7 +1185,7 @@ func TestNodeGetVolumeStats_NotFound(t *testing.T) {
gomock.InOrder(
s.MockDriver().
EXPECT().
Inspect(context.TODO(), []string{id}).
Inspect(gomock.Any(), []string{id}).
Return([]*api.Volume{{
Id: id,
AttachPath: []string{"bad-test", "test-2"},
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestVolumeFromNameFailedToLocateDueToTooManyVolumes(t *testing.T) {
// Expect not found
_, err := VolumeFromName(context.TODO(), driver, name)
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Cannot locate")
assert.Contains(t, err.Error(), "cannot locate")

// Setup calls
gomock.InOrder(
Expand Down

0 comments on commit 314caae

Please sign in to comment.