github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/cmd/juju/machine/export_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package machine 5 6 import ( 7 "github.com/juju/cmd" 8 9 "github.com/juju/juju/cmd/modelcmd" 10 "github.com/juju/juju/storage" 11 ) 12 13 var ( 14 ManualProvisioner = &manualProvisioner 15 ) 16 17 type AddCommand struct { 18 *addCommand 19 } 20 21 // NewAddCommand returns an AddCommand with the api provided as specified. 22 func NewAddCommandForTest(api AddMachineAPI, mcAPI ModelConfigAPI, mmAPI MachineManagerAPI) (cmd.Command, *AddCommand) { 23 cmd := &addCommand{ 24 api: api, 25 machineManagerAPI: mmAPI, 26 modelConfigAPI: mcAPI, 27 } 28 return modelcmd.Wrap(cmd), &AddCommand{cmd} 29 } 30 31 // NewListCommandForTest returns a listMachineCommand with specified api 32 func NewListCommandForTest(api statusAPI) cmd.Command { 33 cmd := newListMachinesCommand(api) 34 return modelcmd.Wrap(cmd) 35 } 36 37 // NewShowCommandForTest returns a showMachineCommand with specified api 38 func NewShowCommandForTest(api statusAPI) cmd.Command { 39 cmd := newShowMachineCommand(api) 40 return modelcmd.Wrap(cmd) 41 } 42 43 type RemoveCommand struct { 44 *removeCommand 45 } 46 47 // NewRemoveCommand returns an RemoveCommand with the api provided as specified. 48 func NewRemoveCommandForTest(api RemoveMachineAPI) (cmd.Command, *RemoveCommand) { 49 cmd := &removeCommand{ 50 api: api, 51 } 52 return modelcmd.Wrap(cmd), &RemoveCommand{cmd} 53 } 54 55 func NewDisksFlag(disks *[]storage.Constraints) *disksFlag { 56 return &disksFlag{disks} 57 }