(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestVolumeUpdate(t *testing.T) { |
| 32 | const ( |
| 33 | expectedURL = "/volumes/test1" |
| 34 | expectedVersion = "version=10" |
| 35 | ) |
| 36 | |
| 37 | client, err := New(WithMockClient(func(req *http.Request) (*http.Response, error) { |
| 38 | if err := assertRequest(req, http.MethodPut, expectedURL); err != nil { |
| 39 | return nil, err |
| 40 | } |
| 41 | if !strings.Contains(req.URL.RawQuery, expectedVersion) { |
| 42 | return nil, fmt.Errorf("expected query to contain '%s', got '%s'", expectedVersion, req.URL.RawQuery) |
| 43 | } |
| 44 | return mockResponse(http.StatusOK, nil, "body")(req) |
| 45 | })) |
| 46 | assert.NilError(t, err) |
| 47 | |
| 48 | _, err = client.VolumeUpdate(t.Context(), "test1", VolumeUpdateOptions{ |
| 49 | Version: swarm.Version{Index: uint64(10)}, |
| 50 | }) |
| 51 | assert.NilError(t, err) |
| 52 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…