本文整理匯總了Golang中github.com/juju/juju/cmd/juju/common.NewCmdBlockHelper函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewCmdBlockHelper函數的具體用法?Golang NewCmdBlockHelper怎麽用?Golang NewCmdBlockHelper使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewCmdBlockHelper函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SetUpTest
func (s *RemoveServiceSuite) SetUpTest(c *gc.C) {
s.RepoSuite.SetUpTest(c)
s.CmdBlockHelper = common.NewCmdBlockHelper(s.APIState)
c.Assert(s.CmdBlockHelper, gc.NotNil)
s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() })
s.stub = &jutesting.Stub{}
s.budgetAPIClient = &mockAPIClient{Stub: s.stub}
s.PatchValue(&getBudgetAPIClient, func(*http.Client) (budgetAPIClient, error) { return s.budgetAPIClient, nil })
}
示例2: SetUpTest
func (s *UpgradeJujuSuite) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
s.resources = common.NewResources()
s.authoriser = apiservertesting.FakeAuthorizer{
Tag: s.AdminUserTag(c),
}
s.CmdBlockHelper = cmdcommon.NewCmdBlockHelper(s.APIState)
c.Assert(s.CmdBlockHelper, gc.NotNil)
s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() })
}
示例3: SetUpTest
func (s *UpgradeCharmSuccessSuite) SetUpTest(c *gc.C) {
s.RepoSuite.SetUpTest(c)
s.path = testcharms.Repo.ClonedDirPath(s.SeriesPath, "riak")
err := runDeploy(c, "local:riak", "riak")
c.Assert(err, jc.ErrorIsNil)
s.riak, err = s.State.Service("riak")
c.Assert(err, jc.ErrorIsNil)
ch, forced, err := s.riak.Charm()
c.Assert(err, jc.ErrorIsNil)
c.Assert(ch.Revision(), gc.Equals, 7)
c.Assert(forced, jc.IsFalse)
s.CmdBlockHelper = common.NewCmdBlockHelper(s.APIState)
c.Assert(s.CmdBlockHelper, gc.NotNil)
s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() })
}
示例4: Reset
// JujuConnSuite very helpfully uploads some default
// tools to the environment's storage. We don't want
// 'em there; but we do want a consistent default-series
// in the environment state.
func (s *UpgradeJujuSuite) Reset(c *gc.C) {
s.JujuConnSuite.Reset(c)
envtesting.RemoveTools(c, s.DefaultToolsStorage, s.Environ.Config().AgentStream())
updateAttrs := map[string]interface{}{
"default-series": "raring",
"agent-version": "1.2.3",
}
err := s.State.UpdateModelConfig(updateAttrs, nil, nil)
c.Assert(err, jc.ErrorIsNil)
s.PatchValue(&sync.BuildToolsTarball, toolstesting.GetMockBuildTools(c))
// Set API host ports so FindTools works.
hostPorts := [][]network.HostPort{
network.NewHostPorts(1234, "0.1.2.3"),
}
err = s.State.SetAPIHostPorts(hostPorts)
c.Assert(err, jc.ErrorIsNil)
s.CmdBlockHelper = cmdcommon.NewCmdBlockHelper(s.APIState)
c.Assert(s.CmdBlockHelper, gc.NotNil)
s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() })
}
示例5: SetUpTest
func (s *ResolvedSuite) SetUpTest(c *gc.C) {
s.RepoSuite.SetUpTest(c)
s.CmdBlockHelper = common.NewCmdBlockHelper(s.APIState)
c.Assert(s.CmdBlockHelper, gc.NotNil)
s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() })
}
示例6: SetUpTest
func (s *keySuiteBase) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
s.CmdBlockHelper = common.NewCmdBlockHelper(s.APIState)
c.Assert(s.CmdBlockHelper, gc.NotNil)
s.AddCleanup(func(*gc.C) { s.CmdBlockHelper.Close() })
}