test

package
v0.0.0-...-447d7c9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2017 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BalooResponse = plugin.NewResponsePlugin(context.HandlerFunc(
	func(ctx *context.Context, h context.Handler) {
		body, err := ioutil.ReadAll(ctx.Response.Body)
		if err != nil {
			h.Error(ctx, err)
			return
		}

		if err := ctx.Response.Body.Close(); err != nil {
			h.Error(ctx, err)
			return
		}

		ctx.Response.Body = ioutil.NopCloser(bytes.NewBuffer(body))

		fmt.Println(string(body))

		h.Next(ctx)
	},
))

BalooResponse is a plugin for HTTP response logging

Functions

This section is empty.

Types

type API

type API struct {
	*base.API

	Bl *baloo.Client
	TS *httptest.Server

	Config  *config.Config
	LogHook *test.Hook

	DatabaseName   string
	FilesystemName string
}

API is a superset of the basic API with additional testing stuff

func InitAPI

func InitAPI() *API

InitAPI initializes a new test API given env params

func (*API) Cleanup

func (t *API) Cleanup() error

Cleanup removes all temporary stuff after tests

Jump to

Keyboard shortcuts

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