mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 02:14:02 +03:00
FILE / ScuroNeko/mtg
mtglib/network/init_test.go
Исходный файл и его история в репозитории.
28 lines
556 B
Go
28 lines
556 B
Go
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://")
|
|
}
|