2018-02-05 16:05:59 -05:00
|
|
|
package transport // import "github.com/docker/docker/pkg/plugins/transport"
|
2017-05-22 05:38:23 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
|
|
|
|
2020-02-07 08:39:24 -05:00
|
|
|
"gotest.tools/v3/assert"
|
|
|
|
is "gotest.tools/v3/assert/cmp"
|
2017-05-22 05:38:23 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestHTTPTransport(t *testing.T) {
|
|
|
|
var r io.Reader
|
|
|
|
roundTripper := &http.Transport{}
|
|
|
|
newTransport := NewHTTPTransport(roundTripper, "http", "0.0.0.0")
|
|
|
|
request, err := newTransport.NewRequest("", r)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-10-12 14:44:07 -04:00
|
|
|
assert.Check(t, is.Equal(http.MethodPost, request.Method))
|
2017-05-22 05:38:23 -04:00
|
|
|
}
|