Package testutils provides utilities for writing gologin tests.
AssertBodyString asserts that a Request Body matches the expected string.
AssertFailureNotCalled is a failure http.Handler that fails if called.
AssertSuccessNotCalled is a success http.Handler that fails if called.
NewErrorServer returns a new httptest.Server, which responds with the given error message and code, and a client which proxies requests to the server using a custom transport. The caller must close the server.
NewTestServerFunc is an adapter to allow the use of ordinary functions as httptest.Server's for testing. Caller must close the server.
TestServer returns a new httptest.Server, its ServeMux for adding handlers, and a client which proxies requests to the server using a custom transport. The caller must close the server.
RewriteTransport rewrites https requests to http to avoid TLS cert issues during testing.
RoundTrip rewrites the request scheme to http and calls through to the composed RoundTripper or if it is nil, to the http.DefaultTransport.