Documentation
¶
Overview ¶
Package dockertest provides a minimal fake Docker Engine API for unit tests in other packages. It enforces the same allow-list as cmd/socket-proxy (403 otherwise) and returns type-appropriate bodies so the SDK wrapper's methods succeed without a real daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
Server *httptest.Server
// ImageUser is returned from image inspect ("" means the image declares no USER).
ImageUser string
// Denied records requests rejected by the allow-list.
Denied []Call
// Containers lists summaries returned by GET /containers/json.
Containers []map[string]any
// contains filtered or unexported fields
}
Fake is a fake Docker daemon.
func (*Fake) CreateBodies ¶
CreateBodies returns the decoded JSON bodies of every POST /containers/create.
Click to show internal directories.
Click to hide internal directories.