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) } }
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 .*") }
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") }
func (s *ToolsListSuite) TestCheckToolsSeriesAcceptsMultipleForSameSeries(c *gc.C) { series := "quantal" list := fakeToolsList(series, series, series) err := envtools.CheckToolsSeries(list, series) c.Check(err, jc.ErrorIsNil) }
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 \\[\\]") }