testing

package
v0.0.0-...-3d086f3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHelper

type BlockHelper struct {
	// contains filtered or unexported fields
}

BlockHelper helps manage blocks for apiserver tests. It provides easy access to switch blocks on as well as test whether operations are blocked or not.

func NewBlockHelper

func NewBlockHelper(st api.Connection) BlockHelper

NewBlockHelper creates a block switch used in testing to manage desired juju blocks.

func (BlockHelper) AssertBlocked

func (s BlockHelper) AssertBlocked(c *gc.C, err error, msg string)

AssertBlocked checks if given error is related to switched block.

func (BlockHelper) BlockAllChanges

func (s BlockHelper) BlockAllChanges(c *gc.C, msg string)

BlockAllChanges blocks all operations that could change the model.

func (BlockHelper) BlockDestroyModel

func (s BlockHelper) BlockDestroyModel(c *gc.C, msg string)

BlockDestroyModel blocks destroy-model.

func (BlockHelper) BlockRemoveObject

func (s BlockHelper) BlockRemoveObject(c *gc.C, msg string)

BlockRemoveObject blocks all operations that remove machines, services, units or relations.

func (BlockHelper) Close

func (s BlockHelper) Close()

type ModelWatcher

type ModelWatcher interface {
	WatchForModelConfigChanges() (params.NotifyWatchResult, error)
	ModelConfig() (params.ModelConfigResult, error)
}

type ModelWatcherTest

type ModelWatcherTest struct {
	// contains filtered or unexported fields
}

func NewModelWatcherTest

func NewModelWatcherTest(
	modelWatcher ModelWatcher,
	st *state.State,
	resources *common.Resources,
) *ModelWatcherTest

func (*ModelWatcherTest) AssertModelConfig

func (s *ModelWatcherTest) AssertModelConfig(c *gc.C, modelWatcher ModelWatcher)

AssertModelConfig provides a method to test the config from the modelWatcher. This allows other tests that embed this type to have more than just the default test.

func (*ModelWatcherTest) TestModelConfig

func (s *ModelWatcherTest) TestModelConfig(c *gc.C)

func (*ModelWatcherTest) TestWatchForModelConfigChanges

func (s *ModelWatcherTest) TestWatchForModelConfigChanges(c *gc.C)

Jump to

Keyboard shortcuts

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