testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testutil contains helpers for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(a []string, s string) bool

ContainsString checks if an array contains a string.

func RandomHash

func RandomHash() *types.Bytes32

RandomHash creates a random hash.

func RandomKey

func RandomKey() []byte

RandomKey returns a random byte array (with max 64 bytes)

func RandomString

func RandomString(n int) string

RandomString generates a random string.

func RandomValue

func RandomValue() []byte

RandomValue returns a random byte array (with max 1024 bytes)

func RequestJSON

func RequestJSON(h http.HandlerFunc, method, target string, payload, dst interface{}) (*httptest.ResponseRecorder, error)

RequestJSON does a request expecting a JSON response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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