tests

package
v2.17.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package tests provides tests helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToFuzzCorpus

func AddToFuzzCorpus(t testing.TB, prefix string, data []byte)

AddToFuzzCorpus adds data to go-fuzz corpus.

func AssertGRPCError

func AssertGRPCError(tb testing.TB, expected *status.Status, actual error)

AssertGRPCError checks that actual error has the same gRPC error code and message as expected error.

func AssertGRPCErrorRE added in v1.5.1

func AssertGRPCErrorRE(tb testing.TB, expectedCode codes.Code, expectedMessageRE string, actual error)

AssertGRPCErrorRE checks that actual error has expected gRPC error code, and error messages matches expected regular expression.

func GenCredentials

func GenCredentials(tb testing.TB) (string, string)

GenCredentials generates test user email and password.

func GenEmail

func GenEmail(tb testing.TB) string

GenEmail generates test user email.

func GetAWSKeys

func GetAWSKeys(tb testing.TB) (accessKey, secretKey string)

GetAWSKeys returns testing AWS keys.

func SetTestIDReader

func SetTestIDReader(t *testing.T)

SetTestIDReader sets IDReader for duration of the test.

Types

type IDReader

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

IDReader is used in tests for ID/UUID generation.

func (*IDReader) Read

func (t *IDReader) Read(b []byte) (int, error)

Read returns non-random data for ID/UUID generation.

Jump to

Keyboard shortcuts

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