Skip to content

Commit

Permalink
found a much simpler way to fix the go vet problem
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Oct 19, 2016
1 parent de0c0fd commit d6be054
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func expectManagerWithContainers(containers []string, query *info.ContainerInfoR
h.On("GetSpec").Return(
spec,
nil,
)
).Once()
handlerMap[h.Name] = h
},
t,
Expand Down Expand Up @@ -216,10 +216,9 @@ func TestGetContainerInfoV2Failure(t *testing.T) {

// Make GetSpec fail on /c2
mockErr := fmt.Errorf("intentional GetSpec failure")
failingHandler := containertest.NewMockContainerHandler(failing)
failingHandler.On("GetSpec").Return(info.ContainerSpec{}, mockErr)
failingHandler.On("Exists").Return(true)
*handlerMap[failing] = *failingHandler
handlerMap[failing].GetSpec() // Use up default GetSpec call, and replace below
handlerMap[failing].On("GetSpec").Return(info.ContainerSpec{}, mockErr)
handlerMap[failing].On("Exists").Return(true)
m.containers[namespacedContainerName{Name: failing}].lastUpdatedTime = time.Time{} // Force GetSpec.

infos, err := m.GetContainerInfoV2("/", options)
Expand Down

0 comments on commit d6be054

Please sign in to comment.