github.com/Pankov404/juju@v0.0.0-20150703034450-be266991dceb/version/supportedseries_windows_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Copyright 2014 Cloudbase Solutions SRL 3 // Licensed under the AGPLv3, see LICENCE file for details. 4 5 package version_test 6 7 import ( 8 "sort" 9 10 jc "github.com/juju/testing/checkers" 11 gc "gopkg.in/check.v1" 12 13 "github.com/juju/juju/testing" 14 "github.com/juju/juju/version" 15 ) 16 17 type supportedSeriesWindowsSuite struct { 18 testing.BaseSuite 19 } 20 21 var _ = gc.Suite(&supportedSeriesWindowsSuite{}) 22 23 func (s *supportedSeriesWindowsSuite) TestSeriesVersion(c *gc.C) { 24 vers, err := version.SeriesVersion("win8") 25 if err != nil { 26 c.Assert(err, gc.Not(gc.ErrorMatches), `invalid series "win8"`, gc.Commentf(`unable to lookup series "win8"`)) 27 } else { 28 c.Assert(err, jc.ErrorIsNil) 29 } 30 c.Assert(err, jc.ErrorIsNil) 31 c.Assert(vers, gc.Equals, "win8") 32 } 33 34 func (s *supportedSeriesWindowsSuite) TestSupportedSeries(c *gc.C) { 35 expectedSeries := []string{ 36 "centos7", 37 "precise", 38 "quantal", 39 "raring", 40 "saucy", 41 "trusty", 42 "utopic", 43 "vivid", 44 "win2012", 45 "win2012hv", 46 "win2012hvr2", 47 "win2012r2", 48 "win7", 49 "win8", 50 "win81", 51 } 52 series := version.SupportedSeries() 53 sort.Strings(series) 54 c.Assert(series, gc.DeepEquals, expectedSeries) 55 }