Documentation ¶
Overview ¶
Package test contains functionality that should be available to all unit tests (which live in separate packages).
Index ¶
- Constants
- func ClearAllTestStorage()
- func ClearTestStorage(t *testing.T, client io.Closer, storage string)
- func CreateTestStorage(t *testing.T) string
- func FindTestdataFolder(t *testing.T) string
- func HTTPGet(t *testing.T, client *http.Client, url string, headers http.Header, ...)
- func HTTPPost(t *testing.T, client *http.Client, url, body string, headers http.Header, ...)
- func NewHTTPClient() *http.Client
- func RunScriptOnDB(t *testing.T, filename string, allowErr bool)
- func SetTestStorageDir(dir string)
- func SetupTestStorage(t *testing.T) string
- func StartBadHttpServer(count uint32, timeout time.Duration, success string)
- func StartSchemeManagerHttpServer()
- func StopBadHttpServer()
- func StopSchemeManagerHttpServer()
- type Signer
Constants ¶
View Source
const PostgresTestUrl = "postgresql://testuser:testpassword@localhost:5432/test"
Variables ¶
This section is empty.
Functions ¶
func ClearAllTestStorage ¶ added in v0.5.0
func ClearAllTestStorage()
func ClearTestStorage ¶
ClearTestStorage removes any output from previously run tests.
func CreateTestStorage ¶
func FindTestdataFolder ¶
FindTestdataFolder finds the "testdata" folder which is in . or .. depending on which package is calling us.
func NewHTTPClient ¶ added in v0.8.0
func RunScriptOnDB ¶ added in v0.8.0
func SetTestStorageDir ¶ added in v0.5.0
func SetTestStorageDir(dir string)
func SetupTestStorage ¶
func StartBadHttpServer ¶
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 ¶
type Signer ¶ added in v0.11.0
type Signer struct {
// contains filtered or unexported fields
}
func LoadSigner ¶ added in v0.11.0
func LoadSigner(t *testing.T, privateKey *ecdsa.PrivateKey) *Signer
Click to show internal directories.
Click to hide internal directories.