本文整理匯總了Golang中github.com/juju/juju/environs/tools.CheckToolsSeries函數的典型用法代碼示例。如果您正苦於以下問題:Golang CheckToolsSeries函數的具體用法?Golang CheckToolsSeries怎麽用?Golang CheckToolsSeries使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CheckToolsSeries函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestCheckToolsSeriesAcceptsOneSetOfTools
func (s *ToolsListSuite) TestCheckToolsSeriesAcceptsOneSetOfTools(c *gc.C) {
names := []string{"precise", "raring"}
for _, series := range names {
list := fakeToolsList(series)
err := envtools.CheckToolsSeries(list, series)
c.Check(err, jc.ErrorIsNil)
}
}
示例2: TestCheckToolsSeriesRejectsToolsForMixedSeries
func (s *ToolsListSuite) TestCheckToolsSeriesRejectsToolsForMixedSeries(c *gc.C) {
list := fakeToolsList("precise", "raring")
err := envtools.CheckToolsSeries(list, "precise")
c.Assert(err, gc.NotNil)
c.Check(err, gc.ErrorMatches, "expected single series, got .*")
}
示例3: TestCheckToolsSeriesRejectsToolsForOtherSeries
func (s *ToolsListSuite) TestCheckToolsSeriesRejectsToolsForOtherSeries(c *gc.C) {
list := fakeToolsList("hoary")
err := envtools.CheckToolsSeries(list, "warty")
c.Assert(err, gc.NotNil)
c.Check(err, gc.ErrorMatches, "tools mismatch: expected series warty, got hoary")
}
示例4: TestCheckToolsSeriesAcceptsMultipleForSameSeries
func (s *ToolsListSuite) TestCheckToolsSeriesAcceptsMultipleForSameSeries(c *gc.C) {
series := "quantal"
list := fakeToolsList(series, series, series)
err := envtools.CheckToolsSeries(list, series)
c.Check(err, jc.ErrorIsNil)
}
示例5: TestCheckToolsSeriesRequiresTools
func (s *ToolsListSuite) TestCheckToolsSeriesRequiresTools(c *gc.C) {
err := envtools.CheckToolsSeries(fakeToolsList(), "precise")
c.Assert(err, gc.NotNil)
c.Check(err, gc.ErrorMatches, "expected single series, got \\[\\]")
}