func (s *uniterV0Suite) SetUpTest(c *gc.C) { s.uniterBaseSuite.setUpTest(c) uniterAPIV0, err := uniter.NewUniterAPIV0( s.State, s.resources, s.authorizer, ) c.Assert(err, jc.ErrorIsNil) s.uniter = uniterAPIV0 meteredAuthorizer := apiservertesting.FakeAuthorizer{ Tag: s.meteredUnit.Tag(), } s.meteredUniter, err = uniter.NewUniterAPIV0( s.State, s.resources, meteredAuthorizer, ) c.Assert(err, jc.ErrorIsNil) s.EnvironWatcherTest = commontesting.NewEnvironWatcherTest( s.uniter, s.State, s.resources, commontesting.NoSecrets, ) }
func (s *uniterV0Suite) TestUniterFailsWithNonUnitAgentUser(c *gc.C) { factory := func(st *state.State, res *common.Resources, auth common.Authorizer) error { _, err := uniter.NewUniterAPIV0(st, res, auth) return err } s.testUniterFailsWithNonUnitAgentUser(c, factory) }
func (s *uniterV0Suite) TestGetPrincipal(c *gc.C) { factory := func( st *state.State, resources *common.Resources, authorizer common.Authorizer, ) (getPrincipal, error) { return uniter.NewUniterAPIV0(st, resources, authorizer) } s.testGetPrincipal(c, s.uniter, factory) }
func (s *uniterV0Suite) TestActionsWrongUnit(c *gc.C) { factory := func( st *state.State, resources *common.Resources, authorizer common.Authorizer, ) (actions, error) { return uniter.NewUniterAPIV0(st, resources, authorizer) } s.testActionsWrongUnit(c, factory) }