github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/juju/osenv/home_test.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package osenv_test
     5  
     6  import (
     7  	gc "gopkg.in/check.v1"
     8  
     9  	"github.com/juju/juju/juju/osenv"
    10  	"github.com/juju/juju/testing"
    11  )
    12  
    13  type JujuXDGDataHomeSuite struct {
    14  	testing.BaseSuite
    15  }
    16  
    17  var _ = gc.Suite(&JujuXDGDataHomeSuite{})
    18  
    19  func (s *JujuXDGDataHomeSuite) TearDownTest(c *gc.C) {
    20  	osenv.SetJujuXDGDataHome("")
    21  }
    22  
    23  func (s *JujuXDGDataHomeSuite) TestStandardHome(c *gc.C) {
    24  	testJujuXDGDataHome := c.MkDir()
    25  	osenv.SetJujuXDGDataHome(testJujuXDGDataHome)
    26  	c.Assert(osenv.JujuXDGDataHome(), gc.Equals, testJujuXDGDataHome)
    27  }
    28  
    29  func (s *JujuXDGDataHomeSuite) TestHomePath(c *gc.C) {
    30  	testJujuHome := c.MkDir()
    31  	osenv.SetJujuXDGDataHome(testJujuHome)
    32  	envPath := osenv.JujuXDGDataHomeDir()
    33  	c.Assert(envPath, gc.Equals, testJujuHome)
    34  }