mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: simplify test with mock-responses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
@@ -35,10 +33,7 @@ func TestPluginDisable(t *testing.T) {
|
||||
if err := assertRequest(req, http.MethodPost, expectedURL); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &http.Response{
|
||||
StatusCode: http.StatusOK,
|
||||
Body: io.NopCloser(bytes.NewReader([]byte(""))),
|
||||
}, nil
|
||||
return mockResponse(http.StatusOK, nil, "")(req)
|
||||
}))
|
||||
assert.NilError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user