Esempio n. 1
0
func (s *ControllersFileSuite) TestReadNoFile(c *gc.C) {
	controllers, err := jujuclient.ReadControllersFile("nohere.yaml")
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(controllers, gc.NotNil)
	c.Assert(controllers.Controllers, gc.HasLen, 0)
	c.Assert(controllers.CurrentController, gc.Equals, "")
}
Esempio n. 2
0
func (s *ControllersSuite) TestSetCurrentController(c *gc.C) {
	err := s.store.AddController(s.controllerName, s.controller)
	c.Assert(err, jc.ErrorIsNil)
	err = s.store.SetCurrentController(s.controllerName)
	c.Assert(err, jc.ErrorIsNil)

	controllers, err := jujuclient.ReadControllersFile(jujuclient.JujuControllersPath())
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(controllers.CurrentController, gc.Equals, s.controllerName)
}
func (s *ControllersFileSuite) TestReadNoFile(c *gc.C) {
	controllers, err := jujuclient.ReadControllersFile("nohere.yaml")
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(controllers, gc.IsNil)
}