juju: github.com/juju/juju/jujuclient/jujuclienttesting Index | Files

package jujuclienttesting

import "github.com/juju/juju/jujuclient/jujuclienttesting"

Index

Package Files

simple.go stub.go

func MinimalStore Uses

func MinimalStore() *jujuclient.MemStore

MinimalStore returns a simple store that can be used with CLI commands under test.

func SetupMinimalFileStore Uses

func SetupMinimalFileStore(c *gc.C)

SetupMinimalFileStore creates a minimal file backed Juju ClientStore in the current XDG Juju directory.

type StubStore Uses

type StubStore struct {
    *testing.Stub

    AllControllersFunc           func() (map[string]jujuclient.ControllerDetails, error)
    ControllerByNameFunc         func(name string) (*jujuclient.ControllerDetails, error)
    ControllerByAPIEndpointsFunc func(endpoints ...string) (*jujuclient.ControllerDetails, string, error)
    AddControllerFunc            func(name string, one jujuclient.ControllerDetails) error
    UpdateControllerFunc         func(name string, one jujuclient.ControllerDetails) error
    RemoveControllerFunc         func(name string) error
    SetCurrentControllerFunc     func(name string) error
    CurrentControllerFunc        func() (string, error)

    UpdateModelFunc     func(controller, model string, details jujuclient.ModelDetails) error
    SetCurrentModelFunc func(controller, model string) error
    RemoveModelFunc     func(controller, model string) error
    AllModelsFunc       func(controller string) (map[string]jujuclient.ModelDetails, error)
    CurrentModelFunc    func(controller string) (string, error)
    ModelByNameFunc     func(controller, model string) (*jujuclient.ModelDetails, error)
    SetModelsFunc       func(controllerName string, models map[string]jujuclient.ModelDetails) error

    UpdateAccountFunc  func(controllerName string, details jujuclient.AccountDetails) error
    AccountDetailsFunc func(controllerName string) (*jujuclient.AccountDetails, error)
    RemoveAccountFunc  func(controllerName string) error

    CredentialForCloudFunc func(string) (*cloud.CloudCredential, error)
    AllCredentialsFunc     func() (map[string]cloud.CloudCredential, error)
    UpdateCredentialFunc   func(cloudName string, details cloud.CloudCredential) error

    BootstrapConfigForControllerFunc func(controllerName string) (*jujuclient.BootstrapConfig, error)
    UpdateBootstrapConfigFunc        func(controllerName string, cfg jujuclient.BootstrapConfig) error

    CookieJarFunc func(controllerName string) (jujuclient.CookieJar, error)
}

func NewStubStore Uses

func NewStubStore() *StubStore

func WrapClientStore Uses

func WrapClientStore(underlying jujuclient.ClientStore) *StubStore

WrapClientStore wraps a ClientStore with a StubStore, where each method calls through to the wrapped store. This can be used to override specific methods, or just to check which calls have been made.

func (*StubStore) AccountDetails Uses

func (c *StubStore) AccountDetails(controllerName string) (*jujuclient.AccountDetails, error)

AccountDetails implements AccountGetter.

func (*StubStore) AddController Uses

func (c *StubStore) AddController(name string, one jujuclient.ControllerDetails) error

AddController implements ControllerUpdater.AddController

func (*StubStore) AllControllers Uses

func (c *StubStore) AllControllers() (map[string]jujuclient.ControllerDetails, error)

AllControllers implements ControllersGetter.AllControllers

func (*StubStore) AllCredentials Uses

func (c *StubStore) AllCredentials() (map[string]cloud.CloudCredential, error)

AllCredentials implements CredentialsGetter.

func (*StubStore) AllModels Uses

func (c *StubStore) AllModels(controller string) (map[string]jujuclient.ModelDetails, error)

AllModels implements ModelGetter.

func (*StubStore) BootstrapConfigForController Uses

func (c *StubStore) BootstrapConfigForController(controllerName string) (*jujuclient.BootstrapConfig, error)

BootstrapConfigForController implements BootstrapConfigGetter.

func (*StubStore) ControllerByAPIEndpoints Uses

func (c *StubStore) ControllerByAPIEndpoints(endpoints ...string) (*jujuclient.ControllerDetails, string, error)

ControllerByAPIEndpoints implements ControllersGetter.ControllerByAPIEndpoints

func (*StubStore) ControllerByName Uses

func (c *StubStore) ControllerByName(name string) (*jujuclient.ControllerDetails, error)

ControllerByName implements ControllersGetter.ControllerByName

func (*StubStore) CookieJar Uses

func (c *StubStore) CookieJar(controllerName string) (jujuclient.CookieJar, error)

func (*StubStore) CredentialForCloud Uses

func (c *StubStore) CredentialForCloud(cloudName string) (*cloud.CloudCredential, error)

CredentialForCloud implements CredentialsGetter.

func (*StubStore) CurrentController Uses

func (c *StubStore) CurrentController() (string, error)

CurrentController implements ControllersGetter.CurrentController.

func (*StubStore) CurrentModel Uses

func (c *StubStore) CurrentModel(controller string) (string, error)

CurrentModel implements ModelGetter.

func (*StubStore) ModelByName Uses

func (c *StubStore) ModelByName(controller, model string) (*jujuclient.ModelDetails, error)

ModelByName implements ModelGetter.

func (*StubStore) RemoveAccount Uses

func (c *StubStore) RemoveAccount(controllerName string) error

RemoveAccount implements AccountRemover.

func (*StubStore) RemoveController Uses

func (c *StubStore) RemoveController(name string) error

RemoveController implements ControllersRemover.RemoveController

func (*StubStore) RemoveModel Uses

func (c *StubStore) RemoveModel(controller, model string) error

RemoveModel implements ModelRemover.

func (*StubStore) SetCurrentController Uses

func (c *StubStore) SetCurrentController(name string) error

SetCurrentController implements ControllerUpdater.SetCurrentController.

func (*StubStore) SetCurrentModel Uses

func (c *StubStore) SetCurrentModel(controller, model string) error

SetCurrentModel implements ModelUpdater.

func (*StubStore) SetModels Uses

func (c *StubStore) SetModels(controller string, models map[string]jujuclient.ModelDetails) error

SetModels implements ModelUpdater.

func (*StubStore) UpdateAccount Uses

func (c *StubStore) UpdateAccount(controllerName string, details jujuclient.AccountDetails) error

UpdateAccount implements AccountUpdater.

func (*StubStore) UpdateBootstrapConfig Uses

func (c *StubStore) UpdateBootstrapConfig(controllerName string, cfg jujuclient.BootstrapConfig) error

UpdateBootstrapConfig implements BootstrapConfigUpdater.

func (*StubStore) UpdateController Uses

func (c *StubStore) UpdateController(name string, one jujuclient.ControllerDetails) error

UpdateController implements ControllerUpdater.UpdateController

func (*StubStore) UpdateCredential Uses

func (c *StubStore) UpdateCredential(cloudName string, details cloud.CloudCredential) error

UpdateCredential implements CredentialsUpdater.

func (*StubStore) UpdateModel Uses

func (c *StubStore) UpdateModel(controller, model string, details jujuclient.ModelDetails) error

UpdateModel implements ModelUpdater.

Package jujuclienttesting imports 6 packages (graph) and is imported by 20 packages. Updated 2019-05-09. Refresh now. Tools for package owners.