testutils

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PlanNotFound represents a mocked response resulting from a plan not found.
	PlanNotFound = mock.Response{Response: http.Response{
		StatusCode: 404,
		Body:       mock.NewStringBody(`{}`),
	}}
)

Functions

func CheckErrType

func CheckErrType(got, want error) error

CheckErrType receives two errors, if either one is not nil, it triggers a comparison between the two, returning an error if the errors are not equal This function is useful for testing to ensure specific error types.

func DeleteFile

func DeleteFile(path string)

DeleteFile removes files generated by tests

func ParseDate

func ParseDate(t *testing.T, date string) strfmt.DateTime

ParseDate parses a string to date and if parsing generates an error, it fails the given testing suite, otherwise it returns the strfmt.Datetime parsed value

Types

This section is empty.

Jump to

Keyboard shortcuts

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