commontest

package
v0.0.0-...-7555876 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const CookieEncryptionKey = "01234567890123456789012345678901"

Variables

This section is empty.

Functions

func AssertContainsFullHTML

func AssertContainsFullHTML(t *testing.T, val string)

func AssertContainsLogin

func AssertContainsLogin(t *testing.T, val string)

func AssertContainsPartialHTML

func AssertContainsPartialHTML(t *testing.T, val string)

func AssertContainsProfile

func AssertContainsProfile(t *testing.T, val string)

func Base64Encoded

func Base64Encoded(t *testing.T, token *oidc.JSONWebToken) string

func Close

func Close(t *testing.T, resp *http.Response)

func FromJSON

func FromJSON[T any](t *testing.T, resp *http.Response) *T

func HTMXRequest

func HTMXRequest() func(*httpRequest)

func NewRequest

func NewRequest(options ...func(*httpRequest)) *http.Request

func ToBytes

func ToBytes(t *testing.T, resp *http.Response) []byte

func ToJSON

func ToJSON(t *testing.T, v interface{}) []byte

func ToString

func ToString(t *testing.T, resp *http.Response) string

func WithAccept

func WithAccept(mimeType string) func(*httpRequest)

func WithBody

func WithBody(body []byte) func(*httpRequest)

func WithCookie

func WithCookie(cookie *http.Cookie) func(*httpRequest)

func WithEncryptedCookie

func WithEncryptedCookie(t *testing.T, cookie http.Cookie) func(*httpRequest)

func WithJSONBody

func WithJSONBody(t *testing.T, v interface{}) func(*httpRequest)

func WithMethod

func WithMethod(m string) func(*httpRequest)

func WithURL

func WithURL(url string) func(*httpRequest)

Types

type DatabaseRunner

type DatabaseRunner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *DatabaseRunner

func (*DatabaseRunner) Connection

func (r *DatabaseRunner) Connection() *postgres.DBConnection

func (*DatabaseRunner) Run

func (r *DatabaseRunner) Run(t *testing.T, runTests func(t *testing.T))

func (*DatabaseRunner) Start

func (r *DatabaseRunner) Start() (*postgres.DBConnection, error)

func (*DatabaseRunner) Stop

func (r *DatabaseRunner) Stop() error

Jump to

Keyboard shortcuts

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