watchertest

package
v0.0.0-...-2608902 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotifyWatcherC

type NotifyWatcherC struct {
	*gc.C
	Watcher   watcher.NotifyWatcher
	PreAssert func()
}

func NewNotifyWatcherC

func NewNotifyWatcherC(c *gc.C, watcher watcher.NotifyWatcher, preAssert func()) NotifyWatcherC

func (NotifyWatcherC) AssertNoChange

func (c NotifyWatcherC) AssertNoChange()

AssertNoChange fails if it manages to read a value from Changes before a short time has passed.

func (NotifyWatcherC) AssertOneChange

func (c NotifyWatcherC) AssertOneChange()

AssertOneChange fails if no change is sent before a long time has passed; or if, subsequent to that, any further change is sent before a short time has passed.

func (NotifyWatcherC) AssertStops

func (c NotifyWatcherC) AssertStops()

AssertStops Kills the watcher and asserts (1) that Wait completes without error before a long time has passed; and (2) that Changes remains open but no values are being sent.

type RelationUnitsWatcherC

type RelationUnitsWatcherC struct {
	*gc.C
	Watcher   watcher.RelationUnitsWatcher
	PreAssert func()
	// contains filtered or unexported fields
}

func NewRelationUnitsWatcherC

func NewRelationUnitsWatcherC(c *gc.C, w watcher.RelationUnitsWatcher, preAssert func()) RelationUnitsWatcherC

NewRelationUnitsWatcherC returns a RelationUnitsWatcherC that checks for aggressive event coalescence.

func (RelationUnitsWatcherC) AssertChange

func (c RelationUnitsWatcherC) AssertChange(changed []string, departed []string)

AssertChange asserts the given changes was reported by the watcher, but does not assume there are no following changes.

func (RelationUnitsWatcherC) AssertNoChange

func (c RelationUnitsWatcherC) AssertNoChange()

func (RelationUnitsWatcherC) AssertStops

func (c RelationUnitsWatcherC) AssertStops()

AssertStops Kills the watcher and asserts (1) that Wait completes without error before a long time has passed; and (2) that Changes remains open but no values are being sent.

type StringsWatcherC

type StringsWatcherC struct {
	*gc.C
	Watcher   watcher.StringsWatcher
	PreAssert func()
}

func NewStringsWatcherC

func NewStringsWatcherC(c *gc.C, watcher watcher.StringsWatcher, preAssert func()) StringsWatcherC

func (StringsWatcherC) AssertChange

func (c StringsWatcherC) AssertChange(expect ...string)

func (StringsWatcherC) AssertChangeInSingleEvent

func (c StringsWatcherC) AssertChangeInSingleEvent(expect ...string)

func (StringsWatcherC) AssertChangeMaybeIncluding

func (c StringsWatcherC) AssertChangeMaybeIncluding(expect ...string)

AssertChangeMaybeIncluding verifies that there is a change that may contain zero to all of the passed in strings, and no other changes.

func (StringsWatcherC) AssertChanges

func (c StringsWatcherC) AssertChanges()

AssertChanges fails if it cannot read a value from Changes despite waiting a long time. It logs, but does not check, the received changes; but will fail if the Changes chan is closed.

func (StringsWatcherC) AssertNoChange

func (c StringsWatcherC) AssertNoChange()

AssertNoChange fails if it manages to read a value from Changes before a short time has passed.

func (StringsWatcherC) AssertStops

func (c StringsWatcherC) AssertStops()

AssertStops Kills the watcher and asserts (1) that Wait completes without error before a long time has passed; and (2) that Changes remains open but no values are being sent.

Jump to

Keyboard shortcuts

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