Documentation ¶
Index ¶
- type MockNotifyWatcher
- type MockStringsWatcher
- type NotifyWatcherC
- type RelationUnitsWatcherC
- type StringsWatcherC
- func (c StringsWatcherC) AssertChange(expect ...string)
- func (c StringsWatcherC) AssertChangeInSingleEvent(expect ...string)
- func (c StringsWatcherC) AssertChangeMaybeIncluding(expect ...string)
- func (c StringsWatcherC) AssertChanges()
- func (c StringsWatcherC) AssertNoChange()
- func (c StringsWatcherC) AssertStops()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockNotifyWatcher ¶
type MockNotifyWatcher struct {
// contains filtered or unexported fields
}
func NewMockNotifyWatcher ¶
func NewMockNotifyWatcher(ch <-chan struct{}) *MockNotifyWatcher
func (*MockNotifyWatcher) Changes ¶
func (w *MockNotifyWatcher) Changes() watcher.NotifyChannel
func (*MockNotifyWatcher) Err ¶
func (w *MockNotifyWatcher) Err() error
func (*MockNotifyWatcher) Kill ¶
func (w *MockNotifyWatcher) Kill()
func (*MockNotifyWatcher) KillErr ¶
func (w *MockNotifyWatcher) KillErr(err error)
KillErr can be used to kill the worker with an error, to simulate a failing watcher.
func (*MockNotifyWatcher) Stop ¶
func (w *MockNotifyWatcher) Stop() error
func (*MockNotifyWatcher) Wait ¶
func (w *MockNotifyWatcher) Wait() error
type MockStringsWatcher ¶
type MockStringsWatcher struct {
// contains filtered or unexported fields
}
func NewMockStringsWatcher ¶
func NewMockStringsWatcher(ch <-chan []string) *MockStringsWatcher
func (*MockStringsWatcher) Changes ¶
func (w *MockStringsWatcher) Changes() watcher.StringsChannel
func (*MockStringsWatcher) Err ¶
func (w *MockStringsWatcher) Err() error
func (*MockStringsWatcher) Kill ¶
func (w *MockStringsWatcher) Kill()
func (*MockStringsWatcher) KillErr ¶
func (w *MockStringsWatcher) KillErr(err error)
KillErr can be used to kill the worker with an error, to simulate a failing watcher.
func (*MockStringsWatcher) Stop ¶
func (w *MockStringsWatcher) Stop() error
func (*MockStringsWatcher) Wait ¶
func (w *MockStringsWatcher) Wait() error
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) AssertKilled ¶
func (c NotifyWatcherC) AssertKilled()
AssertKilled Kills the watcher and asserts that Wait completes without error before a long time has passed.
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, appChanged []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.