~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/controller/export_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
        "github.com/juju/juju/api"
11
11
        "github.com/juju/juju/cmd/modelcmd"
12
 
        "github.com/juju/juju/environs/configstore"
13
12
        "github.com/juju/juju/jujuclient"
14
13
)
15
14
 
38
37
func NewCreateModelCommandForTest(
39
38
        api CreateModelAPI,
40
39
        store jujuclient.ClientStore,
41
 
        parser func(interface{}) (interface{}, error),
 
40
        credentialStore jujuclient.CredentialStore,
42
41
) (cmd.Command, *CreateModelCommand) {
43
42
        c := &createModelCommand{
44
 
                api:          api,
45
 
                configParser: parser,
 
43
                api:             api,
 
44
                credentialStore: credentialStore,
46
45
        }
47
46
        c.SetClientStore(store)
48
47
        return modelcmd.WrapController(c), &CreateModelCommand{c}
49
48
}
50
49
 
51
 
// NewListModelsCommandForTest returns a EnvironmentsCommand with the API
 
50
// NewListModelsCommandForTest returns a ListModelsCommand with the API
52
51
// and userCreds provided as specified.
53
 
func NewListModelsCommandForTest(modelAPI ModelManagerAPI, sysAPI ModelsSysAPI, store jujuclient.ClientStore, userCreds *configstore.APICredentials) cmd.Command {
 
52
func NewListModelsCommandForTest(modelAPI ModelManagerAPI, sysAPI ModelsSysAPI, store jujuclient.ClientStore) cmd.Command {
54
53
        c := &modelsCommand{
55
 
                modelAPI:  modelAPI,
56
 
                sysAPI:    sysAPI,
57
 
                userCreds: userCreds,
 
54
                modelAPI: modelAPI,
 
55
                sysAPI:   sysAPI,
58
56
        }
59
57
        c.SetClientStore(store)
60
58
        return modelcmd.WrapController(c)
62
60
 
63
61
// NewRegisterCommandForTest returns a RegisterCommand with the function used
64
62
// to open the API connection mocked out.
65
 
func NewRegisterCommandForTest(apiOpen api.OpenFunc, newAPIRoot modelcmd.OpenFunc, store jujuclient.ClientStore) *registerCommand {
66
 
        return &registerCommand{apiOpen: apiOpen, newAPIRoot: newAPIRoot, store: store}
 
63
func NewRegisterCommandForTest(apiOpen api.OpenFunc, refreshModels func(jujuclient.ClientStore, string, string) error, store jujuclient.ClientStore) *registerCommand {
 
64
        return &registerCommand{apiOpen: apiOpen, refreshModels: refreshModels, store: store}
67
65
}
68
66
 
69
67
// NewRemoveBlocksCommandForTest returns a RemoveBlocksCommand with the