Documentation
¶
Index ¶
- func AssertFileContains(t *testing.T, path, content string)
- func GetSha256Integrity(content string) string
- func HttpHandler(handler http.HandlerFunc) (int, *httptest.Server)
- func TestHttpHandler(content string, t *testing.T) int
- func TestHttpHandlerWithServer(content string, t *testing.T) (int, *httptest.Server)
- func TmpDir(t *testing.T) string
- func TmpFile(t *testing.T, content string) string
- type RecordedRequest
- type RecorderHttpServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFileContains ¶
AssertFileContains asserts that the file at the given path exists and contains the given content.
func GetSha256Integrity ¶
func HttpHandler ¶
func HttpHandler(handler http.HandlerFunc) (int, *httptest.Server)
func TestHttpHandler ¶
TestHttpHandler creates a new HTTP server and returns the port and serves the given content. Its lifetime is tied to the given testing.T object.
Types ¶
type RecordedRequest ¶
func NewRecordedRequest ¶
func NewRecordedRequest(r *http.Request) *RecordedRequest
type RecorderHttpServer ¶
type RecorderHttpServer struct {
*httptest.Server
Requests *[]RecordedRequest
}
func NewRecorderHttpServer ¶
func NewRecorderHttpServer(handler http.HandlerFunc, t *testing.T) (*RecorderHttpServer, int)
Click to show internal directories.
Click to hide internal directories.