github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/state/utils/environ_test.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package utils_test
     5  
     6  import (
     7  	jc "github.com/juju/testing/checkers"
     8  	gc "gopkg.in/check.v1"
     9  
    10  	"github.com/juju/juju/juju/testing"
    11  	"github.com/juju/juju/state/utils"
    12  )
    13  
    14  type environSuite struct {
    15  	testing.JujuConnSuite
    16  }
    17  
    18  var _ = gc.Suite(&environSuite{})
    19  
    20  func (s *environSuite) TestGetEnvironment(c *gc.C) {
    21  	env, err := utils.GetEnviron(s.State)
    22  	c.Assert(err, jc.ErrorIsNil)
    23  	config, err := s.State.ModelConfig()
    24  	c.Assert(err, jc.ErrorIsNil)
    25  
    26  	c.Check(env.Config(), jc.DeepEquals, config)
    27  	c.Check(env, gc.Not(gc.Equals), s.Environ)
    28  }