juju: github.com/juju/juju/apiserver/common/testing Index | Files

package testing

import "github.com/juju/juju/apiserver/common/testing"


Package Files

block.go modelwatcher.go

type BlockHelper Uses

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 Uses

func NewBlockHelper(st api.Connection) BlockHelper

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

func (BlockHelper) AssertBlocked Uses

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

AssertBlocked checks if given error is related to switched block.

func (BlockHelper) BlockAllChanges Uses

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

BlockAllChanges blocks all operations that could change the model.

func (BlockHelper) BlockDestroyModel Uses

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

BlockDestroyModel blocks destroy-model.

func (BlockHelper) BlockRemoveObject Uses

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

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

func (BlockHelper) Close Uses

func (s BlockHelper) Close()

type ModelWatcher Uses

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

type ModelWatcherTest Uses

type ModelWatcherTest struct {
    // contains filtered or unexported fields

func NewModelWatcherTest Uses

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

func (*ModelWatcherTest) AssertModelConfig Uses

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 Uses

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

func (*ModelWatcherTest) TestWatchForModelConfigChanges Uses

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

Package testing imports 11 packages (graph). Updated 2019-11-07. Refresh now. Tools for package owners.