func newWatchFixture(c *gc.C, working bool) *watchFixture { backend := &watchBackend{working: working} resources := common.NewResources() facade, err := applicationscaler.NewFacade(backend, resources, auth(true)) c.Assert(err, jc.ErrorIsNil) return &watchFixture{facade, resources} }
func newRescaleFixture(c *gc.C) *rescaleFixture { facade, err := applicationscaler.NewFacade(rescaleBackend{}, nil, auth(true)) c.Assert(err, jc.ErrorIsNil) return &rescaleFixture{facade} }
func (s *FacadeSuite) TestNotModelManager(c *gc.C) { facade, err := applicationscaler.NewFacade(nil, nil, auth(false)) c.Check(err, gc.Equals, common.ErrPerm) c.Check(facade, gc.IsNil) }
func (s *FacadeSuite) TestModelManager(c *gc.C) { facade, err := applicationscaler.NewFacade(nil, nil, auth(true)) c.Check(err, jc.ErrorIsNil) c.Check(facade, gc.NotNil) }