testutil

package
v0.0.0-...-4a9a683 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBytes

func AssertBytes(tb testing.TB, expected []byte, actual []byte, msg string, v ...interface{})

AssertBytes asserts that 2 []byte are equal

func AssertEqual

func AssertEqual(tb testing.TB, actual, expected, msg string, v ...interface{})

AssertEqual asserts that 2 strings are equal

func AssertStatus

func AssertStatus(tb testing.TB, actual int, expected int, v ...interface{})

AssertStatus asserts that the HTTP status code is as expected

func ImportRole

func ImportRole(k8s *fake.Clientset, path string) error

ImportRole imports a role into a fake k8s instance

func ImportRoleBinding

func ImportRoleBinding(k8s *fake.Clientset, path string) error

ImportRoleBinding imports rolebinding into a fake k8s instance

func MustReadFile

func MustReadFile(tb testing.TB, filename string, v ...interface{}) []byte

MustReadFile fails the test if a file cannot be read

func ServeFakeHTTP

func ServeFakeHTTP(router *mux.Router, method, url string, headers []string, body ...string) *httptest.ResponseRecorder

ServeFakeHTTP creates a fake request and records the response from a relevant route.

Types

This section is empty.

Jump to

Keyboard shortcuts

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