gopkg.in/docker/docker.v23@v23.0.11/pkg/plugins/transport/http_test.go (about)

     1  package transport // import "github.com/docker/docker/pkg/plugins/transport"
     2  
     3  import (
     4  	"io"
     5  	"net/http"
     6  	"testing"
     7  
     8  	"gotest.tools/v3/assert"
     9  	is "gotest.tools/v3/assert/cmp"
    10  )
    11  
    12  func TestHTTPTransport(t *testing.T) {
    13  	var r io.Reader
    14  	roundTripper := &http.Transport{}
    15  	newTransport := NewHTTPTransport(roundTripper, "http", "0.0.0.0")
    16  	request, err := newTransport.NewRequest("", r)
    17  	if err != nil {
    18  		t.Fatal(err)
    19  	}
    20  	assert.Check(t, is.Equal(http.MethodPost, request.Method))
    21  }