faas-cli: github.com/openfaas/faas-cli/test Index | Files

package test

import "github.com/openfaas/faas-cli/test"

Index

Package Files

utils.go

func CaptureStdout Uses

func CaptureStdout(f func()) string

func MockHttpServer Uses

func MockHttpServer(t *testing.T, requests []Request) *server

MockHttpServer creates a test server which will send responses in the given order It is possible to check on Method and Uri if set Responses can contain JSON-encoded body if ResponseBody is set

func MockHttpServerStatus Uses

func MockHttpServerStatus(t *testing.T, statusCode ...int) *server

MockHttpServerStatus creates a test server which will send empty responses with the given status code the responses which will be sent are in the given order

type Request Uses

type Request struct {
    Method             string
    Uri                string
    ResponseStatusCode int
    ResponseBody       interface{}
}

Package test imports 7 packages (graph). Updated 2018-09-06. Refresh now. Tools for package owners.