test

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package test contains functionality that should be available to all unit tests (which live in separate packages).

Index

Constants

View Source
const PostgresTestUrl = "postgresql://localhost:5432/test"

Variables

This section is empty.

Functions

func ClearAllTestStorage added in v0.5.0

func ClearAllTestStorage()

func ClearTestStorage

func ClearTestStorage(t *testing.T, storage string)

ClearTestStorage removes any output from previously run tests.

func CreateTestStorage

func CreateTestStorage(t *testing.T) string

func FindTestdataFolder

func FindTestdataFolder(t *testing.T) string

FindTestdataFolder finds the "testdata" folder which is in . or .. depending on which package is calling us.

func HTTPGet added in v0.8.0

func HTTPGet(t *testing.T, client *http.Client, url string, headers http.Header, expectedStatus int, result interface{})

func HTTPPost added in v0.8.0

func HTTPPost(t *testing.T, client *http.Client, url, body string, headers http.Header, expectedStatus int, result interface{})

func NewHTTPClient added in v0.8.0

func NewHTTPClient() *http.Client

func RunScriptOnDB added in v0.8.0

func RunScriptOnDB(t *testing.T, filename string, allowErr bool)

func SetTestStorageDir added in v0.5.0

func SetTestStorageDir(dir string)

func SetupTestStorage

func SetupTestStorage(t *testing.T) string

func StartBadHttpServer

func StartBadHttpServer(count int, timeout time.Duration, success string)

StartBadHttpServer starts an HTTP server that times out and returns 500 on the first few times.

func StartSchemeManagerHttpServer

func StartSchemeManagerHttpServer()

func StopBadHttpServer

func StopBadHttpServer()

func StopSchemeManagerHttpServer

func StopSchemeManagerHttpServer()

Types

This section is empty.

Jump to

Keyboard shortcuts

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