Add tests for socks dialer

This commit is contained in:
9seconds
2021-03-05 17:36:21 +03:00
parent 0ed7e10379
commit 88e076a283
5 changed files with 124 additions and 20 deletions
+27
View File
@@ -0,0 +1,27 @@
package network_test
import (
"net/http/httptest"
"strings"
"github.com/mccutchen/go-httpbin/httpbin"
"github.com/stretchr/testify/suite"
)
type HTTPServerTestSuite struct {
suite.Suite
httpServer *httptest.Server
}
func (suite *HTTPServerTestSuite) SetupSuite() {
suite.httpServer = httptest.NewServer(httpbin.NewHTTPBin().Handler())
}
func (suite *HTTPServerTestSuite) TearDownSuite() {
suite.httpServer.Close()
}
func (suite *HTTPServerTestSuite) HTTPServerAddress() string {
return strings.TrimPrefix(suite.httpServer.URL, "http://")
}