github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/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 "arch", 37 "centos7", 38 "precise", 39 "quantal", 40 "raring", 41 "saucy", 42 "trusty", 43 "utopic", 44 "vivid", 45 "win10", 46 "win2012", 47 "win2012hv", 48 "win2012hvr2", 49 "win2012r2", 50 "win7", 51 "win8", 52 "win81", 53 } 54 series := version.SupportedSeries() 55 sort.Strings(series) 56 c.Assert(series, gc.DeepEquals, expectedSeries) 57 }