Skip to content

Commit

Permalink
update fakes
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiewigmore committed Apr 11, 2024
1 parent 059d6bc commit ea10e39
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions fakes/daemon_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,23 @@ import (
"sync"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"
)

type DockerDaemonClient struct {
ImageHistoryCall struct {
mutex sync.Mutex
CallCount int
Receives struct {
Context context.Context
String string
}
Returns struct {
HistoryResponseItemSlice []image.HistoryResponseItem
Error error
}
Stub func(context.Context, string) ([]image.HistoryResponseItem, error)
}
ImageInspectWithRawCall struct {
mutex sync.Mutex
CallCount int
Expand Down Expand Up @@ -73,6 +87,17 @@ type DockerDaemonClient struct {
}
}

func (f *DockerDaemonClient) ImageHistory(param1 context.Context, param2 string) ([]image.HistoryResponseItem, error) {
f.ImageHistoryCall.mutex.Lock()
defer f.ImageHistoryCall.mutex.Unlock()
f.ImageHistoryCall.CallCount++
f.ImageHistoryCall.Receives.Context = param1
f.ImageHistoryCall.Receives.String = param2
if f.ImageHistoryCall.Stub != nil {
return f.ImageHistoryCall.Stub(param1, param2)
}
return f.ImageHistoryCall.Returns.HistoryResponseItemSlice, f.ImageHistoryCall.Returns.Error
}
func (f *DockerDaemonClient) ImageInspectWithRaw(param1 context.Context, param2 string) (types.ImageInspect, []byte, error) {
f.ImageInspectWithRawCall.mutex.Lock()
defer f.ImageInspectWithRawCall.mutex.Unlock()
Expand Down

0 comments on commit ea10e39

Please sign in to comment.