testing

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckingAPICaller

func CheckingAPICaller(c *gc.C, args *CheckArgs, numCalls *int, err error) base.APICallCloser

CheckingAPICaller returns an APICallerFunc which can report the number of times its APICall() method was called (if numCalls is not nil), as well as check if any of the arguments passed to the APICall() method match the values given in args (if args itself is not nil, otherwise no arguments are checked). The final error result of the APICall() will be set to err.

func NotifyingCheckingAPICaller

func NotifyingCheckingAPICaller(c *gc.C, args *CheckArgs, called chan struct{}, err error) base.APICaller

NotifyingCheckingAPICaller returns an APICallerFunc which sends a message on the channel "called" every time it recives a call, as well as check if any of the arguments passed to the APICall() method match the values given in args (if args itself is not nil, otherwise no arguments are checked). The final error result of the APICall() will be set to err.

func PatchFacadeCall

func PatchFacadeCall(p Patcher, caller *base.FacadeCaller, f func(request string, params, response interface{}) error)

PatchFacadeCall patches the provided FacadeCaller such that the FacadeCall method calls are diverted to the provided function.

Types

type APICallerFunc

type APICallerFunc func(objType string, version int, id, request string, params, response interface{}) error

APICallerFunc is a function type that implements APICaller.

func (APICallerFunc) APICall

func (f APICallerFunc) APICall(objType string, version int, id, request string, params, response interface{}) error

func (APICallerFunc) BestFacadeVersion

func (APICallerFunc) BestFacadeVersion(facade string) int

func (APICallerFunc) Close

func (APICallerFunc) Close() error

func (APICallerFunc) EnvironTag

func (APICallerFunc) EnvironTag() (names.EnvironTag, error)

type CheckArgs

type CheckArgs struct {
	Facade  string
	Version int
	Id      string
	Method  string
	Args    interface{}
	Results interface{}

	IdIsEmpty     bool
	VersionIsZero bool
}

CheckArgs holds the possible arguments to CheckingAPICaller(). Any fields non empty fields will be checked to match the arguments recieved by the APICall() method of the returned APICallerFunc. If Id is empty, but IdIsEmpty is true, the id argument is checked to be empty. The same applies to Version being empty, but if VersionIsZero set to true the version is checked to be 0.

type Patcher

type Patcher interface {
	PatchValue(dest, value interface{})
}

Jump to

Keyboard shortcuts

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