MCPcopy
hub / github.com/moby/moby / TestCheckpointList

Function TestCheckpointList

client/checkpoint_list_test.go:23–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestCheckpointList(t *testing.T) {
24 const expectedURL = "/containers/container_id/checkpoints"
25
26 client, err := New(
27 WithMockClient(func(req *http.Request) (*http.Response, error) {
28 if err := assertRequest(req, http.MethodGet, expectedURL); err != nil {
29 return nil, err
30 }
31 return mockJSONResponse(http.StatusOK, nil, []checkpoint.Summary{
32 {Name: "checkpoint"},
33 })(req)
34 }),
35 )
36 assert.NilError(t, err)
37
38 res, err := client.CheckpointList(t.Context(), "container_id", CheckpointListOptions{})
39 assert.NilError(t, err)
40 assert.Check(t, is.Len(res.Items, 1))
41}
42
43func TestCheckpointListContainerNotFound(t *testing.T) {
44 client, err := New(

Callers

nothing calls this directly

Calls 8

WithMockClientFunction · 0.85
assertRequestFunction · 0.85
mockJSONResponseFunction · 0.85
CheckMethod · 0.80
NewFunction · 0.70
CheckpointListMethod · 0.65
ContextMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…