github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/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, mmApi MachineManagerAPI) (cmd.Command, *AddCommand) { 23 cmd := &addCommand{ 24 api: api, 25 machineManagerAPI: mmApi, 26 } 27 return modelcmd.Wrap(cmd), &AddCommand{cmd} 28 } 29 30 // NewListCommandForTest returns a listMachineCommand with specified api 31 func NewListCommandForTest(api statusAPI) cmd.Command { 32 cmd := newListMachinesCommand(api) 33 return modelcmd.Wrap(cmd) 34 } 35 36 // NewShowCommandForTest returns a showMachineCommand with specified api 37 func NewShowCommandForTest(api statusAPI) cmd.Command { 38 cmd := newShowMachineCommand(api) 39 return modelcmd.Wrap(cmd) 40 } 41 42 type RemoveCommand struct { 43 *removeCommand 44 } 45 46 // NewRemoveCommand returns an RemoveCommand with the api provided as specified. 47 func NewRemoveCommandForTest(api RemoveMachineAPI) (cmd.Command, *RemoveCommand) { 48 cmd := &removeCommand{ 49 api: api, 50 } 51 return modelcmd.Wrap(cmd), &RemoveCommand{cmd} 52 } 53 54 func NewDisksFlag(disks *[]storage.Constraints) *disksFlag { 55 return &disksFlag{disks} 56 }