Esempio n. 1
0
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}
}
Esempio n. 2
0
func newRescaleFixture(c *gc.C) *rescaleFixture {
	facade, err := applicationscaler.NewFacade(rescaleBackend{}, nil, auth(true))
	c.Assert(err, jc.ErrorIsNil)
	return &rescaleFixture{facade}
}
Esempio n. 3
0
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)
}
Esempio n. 4
0
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)
}