github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/api/agent/model_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package agent_test 5 6 import ( 7 jc "github.com/juju/testing/checkers" 8 gc "gopkg.in/check.v1" 9 10 "github.com/juju/juju/api/agent" 11 apitesting "github.com/juju/juju/api/testing" 12 jujutesting "github.com/juju/juju/juju/testing" 13 ) 14 15 type modelSuite struct { 16 jujutesting.JujuConnSuite 17 *apitesting.ModelWatcherTests 18 } 19 20 var _ = gc.Suite(&modelSuite{}) 21 22 func (s *modelSuite) SetUpTest(c *gc.C) { 23 s.JujuConnSuite.SetUpTest(c) 24 25 stateAPI, _ := s.OpenAPIAsNewMachine(c) 26 27 agentAPI, err := agent.NewState(stateAPI) 28 c.Assert(agentAPI, gc.NotNil) 29 c.Assert(err, jc.ErrorIsNil) 30 31 s.ModelWatcherTests = apitesting.NewModelWatcherTests( 32 agentAPI, s.BackingState, s.Model, 33 ) 34 }