utils

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Logger set with writer

Functions

func AssertEqualProto

func AssertEqualProto(t *testing.T, expected, actual proto.Message)

func AssertEqualProtos

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

func AssertJSON added in v0.9.1

func AssertJSON(t *testing.T, expected, actual interface{}, expectedDiff jsondiff.Difference)

func AssertJSONEq added in v0.9.1

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

func AssertJSONFile added in v0.9.1

func AssertJSONFile(t *testing.T, expectedFilePath string, actual []*v1beta2.Asset, expectedDiff jsondiff.Difference)

func AssertProtosWithJSONFile

func AssertProtosWithJSONFile(t *testing.T, expectedFilePath string, actual []*v1beta2.Asset)

func BuildAny

func BuildAny(t *testing.T, protoMessage protoreflect.ProtoMessage) *anypb.Any

func BuildStruct

func BuildStruct(t *testing.T, value map[string]interface{}) *structpb.Struct

func CreateContainer

func CreateContainer(opts dockertest.RunOptions, retryOp func(r *dockertest.Resource) error) (func() error, error)

CreateContainer will create a docker container using the RunOptions given

"opts" is the configuration for docker

"retryOp" is an exponential backoff-retry, because the application in the container might not be ready to accept connections yet

func LoadJSON

func LoadJSON(t *testing.T, filePath string, v interface{})

func Respond

func Respond(t *testing.T, w http.ResponseWriter, status int, v interface{})

func SortedAssets added in v0.9.1

func SortedAssets(assets []*v1beta2.Asset) []*v1beta2.Asset

func ValueAsJSONReader

func ValueAsJSONReader(t *testing.T, v interface{}) io.ReadCloser

Types

type ArgMatcher

type ArgMatcher interface{ Matches(interface{}) bool }

func OfTypeContext

func OfTypeContext() ArgMatcher

Jump to

Keyboard shortcuts

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