(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func 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 | |
| 43 | func TestCheckpointListContainerNotFound(t *testing.T) { |
| 44 | client, err := New( |
nothing calls this directly
no test coverage detected
searching dependent graphs…