testutils

package
v0.0.0-...-ceb5cd5 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareObjects

func CompareObjects(actual interface{}, expected interface{}) error

CompareObjects checks equality of 2 objects and returns a formatted error on failure. If the object types have unexported fields, a custom marshaler is required to be defined.

func FailOnError

func FailOnError(t *testing.T, err error)

FailOnError logs the error and terminates the test immediately

func FailOnNil

func FailOnNil(t *testing.T, obj interface{})

FailOnNil terminates the test immediately if the argument is nil and logs the reason

func GetRouterVersion

func GetRouterVersion(t *testing.T, filePath string) *models.RouterVersion

GetRouterVersion reads the given file, attempts to convert the contents into a router version model object and returns it. The method records a failure to the test s if an error is encountered.

func ReadFile

func ReadFile(filepath string) ([]byte, error)

ReadFile reads a file and returns the byte contents

Types

This section is empty.

Jump to

Keyboard shortcuts

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