xtestutil

package
v0.0.0-...-ce03e45 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TestDBHost = "127.0.0.1"
View Source
const TestDBName = "idp_test"
View Source
const TestDBPassword = "idp_test"
View Source
const TestDBPort = 13306
View Source
const TestDBUser = "idp_test"
View Source
const TestRedisDB = 1
View Source
const TestRedisHost = "127.0.0.1"
View Source
const TestRedisPassword = ""
View Source
const TestRedisPort = 16379

Variables

This section is empty.

Functions

func AssertResponse

func AssertResponse(t *testing.T, want *Response, got *http.Response)

func AssertResponseJSON

func AssertResponseJSON(t *testing.T, want *Response, got *http.Response)

func CloseResponseBody

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

func CompareType

func CompareType(t *testing.T, v1, v2 any)

func CompareValue

func CompareValue(t *testing.T, v1, v2 any)

func ExitOnError

func ExitOnError(t *testing.T, err error)

func LoadFile

func LoadFile(t *testing.T, path string) []byte

func NewCache

func NewCache(t *testing.T) *datastore.Cache

func NewDatabase

func NewDatabase(t *testing.T, c *config.Config) *datastore.Database

func Request

func Request(t *testing.T, c *http.Client, method string, u *url.URL, p *RequestParam, data []byte) (*http.Response, error)

Types

type FixedClocker

type FixedClocker struct{}

func (FixedClocker) Now

func (v FixedClocker) Now() time.Time

type FixedTomorrowClocker

type FixedTomorrowClocker struct{}

func (FixedTomorrowClocker) Now

func (v FixedTomorrowClocker) Now() time.Time

type RequestParam

type RequestParam struct {
	Cookies []*http.Cookie
	Headers map[string]string
}

type Response

type Response struct {
	StatusCode int
	Location   *url.URL
	Body       []byte
}

Jump to

Keyboard shortcuts

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