github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/cmd/juju/firewall/export_test.go (about) 1 // Copyright 2017 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package firewall 5 6 import ( 7 "github.com/juju/cmd" 8 9 "github.com/juju/juju/cmd/modelcmd" 10 "github.com/juju/juju/jujuclient/jujuclienttesting" 11 ) 12 13 func NewListRulesCommandForTest( 14 api ListFirewallRulesAPI, 15 ) cmd.Command { 16 aCmd := &listFirewallRulesCommand{ 17 newAPIFunc: func() (ListFirewallRulesAPI, error) { 18 return api, nil 19 }, 20 } 21 aCmd.SetClientStore(jujuclienttesting.MinimalStore()) 22 return modelcmd.Wrap(aCmd) 23 } 24 25 func NewSetRulesCommandForTest( 26 api SetFirewallRuleAPI, 27 ) cmd.Command { 28 aCmd := &setFirewallRuleCommand{ 29 newAPIFunc: func() (SetFirewallRuleAPI, error) { 30 return api, nil 31 }, 32 } 33 aCmd.SetClientStore(jujuclienttesting.MinimalStore()) 34 return modelcmd.Wrap(aCmd) 35 }