testutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SentryDSN = `http://thisis:myfakeauth@localhost/1`

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(t *testing.T, expected interface{}, actual interface{})

AssertEqual is a semantic test assertion for object equality.

func AssertFalse

func AssertFalse(t *testing.T, object bool)

AssertFalse is a semantic test assertion for object truthiness.

func AssertNearEqual

func AssertNearEqual(t *testing.T, expected int64, actual int64, delta int64)

AssertNearEqual is a semantic test assertion for numeric accuracy.

func AssertNil

func AssertNil(t *testing.T, object interface{})

AssertNil is a semantic test assertion for nility.

func AssertNotEqual

func AssertNotEqual(t *testing.T, expected interface{}, actual interface{})

AssertNotEqual is a semantic test assertion for object equality.

func AssertNotNil

func AssertNotNil(t *testing.T, object interface{})

AssertNotNil is a semantic test assertion for nility.

func AssertNotPanics added in v1.1.0

func AssertNotPanics(t *testing.T, fn func())

AssertNotPanics is a semantic test assertion that a function does not panic.

func AssertNotSame

func AssertNotSame(t *testing.T, expected interface{}, actual interface{})

AssertNotSame is a semantic test assertion for referential equality.

func AssertSame

func AssertSame(t *testing.T, expected interface{}, actual interface{})

AssertSame is a semantic test assertion for referential equality.

func AssertStringContains

func AssertStringContains(t *testing.T, expectedContained string, actualContaining string)

AssertStringContains is a semantic test assertion for partial string matching.

func AssertTrue

func AssertTrue(t *testing.T, object bool)

AssertTrue is a semantic test assertion for object truthiness.

func BindSentryClient

func BindSentryClient(t *testing.T, tcp *http.Transport)

BindSentryClient attaches a Sentry server transport (from fake Sentry) to the Sentry SDK's CurrentHub .It assumes that a logger has been instantiated, which initializes the Sentry SDK. Note: this is data-race free but not race-condition free on the Sentry Hub. Use with caution from multiple goroutines.

func NewConfigWithBuffer

func NewConfigWithBuffer(t *testing.T, logLevel log.Level) (*log.Config, *bytes.Buffer)

NewConfigWithBuffer generates a default testing config (log.Level is set to log.INFO and EnableErrStack is true) and a linked output buffer that the logger writes too.

func SentryServer

func SentryServer(t *testing.T, logMessages bool) (fakesentry.Server, func(t *testing.T) []byte)

SentryServer generates a new fake Sentry server to field requests, and binds the "CurrentHub" client to it. The server instance is returned as well as a function that returns received messages (bytes) or times out and fails the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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