envtest

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFormRequest

func BuildFormRequest(ctx context.Context, tb testing.TB, meth, pth string, v *url.Values) (*httptest.ResponseRecorder, *http.Request)

BuildFormRequest builds an http request and http response recorder for the given form values (expressed as url.Values). It sets the proper headers and response types to post as a form and expect HTML in return.

Types

type ServerConfigResponse

type ServerConfigResponse struct {
	Config    *config.UIServiceConfig
	Renderer  *renderer.Renderer
	Processor *justification.Processor
}

ServerConfigResponse is the response from creating a server config.

func NewServerConfig

func NewServerConfig(tb testing.TB, port string, allowlist []string, devMode bool) *ServerConfigResponse

NewServerConfig creates a new server configuration. It creates all the keys, databases, and cacher, but does not actually start the server. All cleanup is scheduled by t.Cleanup.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL