func (s *LoginSuite) TestWritesCurrentController(c *gc.C) { _, err := s.runServerFile(c) c.Assert(err, jc.ErrorIsNil) currentController, err := envcmd.ReadCurrentController() c.Assert(err, jc.ErrorIsNil) c.Assert(currentController, gc.Equals, "foo") }
func (s *SwitchSimpleSuite) TestSettingWritesControllerFile(c *gc.C) { s.addTestController(c) context, err := testing.RunCommand(c, newSwitchCommand(), "a-controller") c.Assert(err, jc.ErrorIsNil) c.Assert(testing.Stderr(context), gc.Equals, "-> a-controller (controller)\n") currController, err := envcmd.ReadCurrentController() c.Assert(err, jc.ErrorIsNil) c.Assert(currController, gc.Equals, "a-controller") }
func (s *filesSuite) assertCurrentController(c *gc.C, controllerName string) { current, err := envcmd.ReadCurrentController() c.Assert(err, jc.ErrorIsNil) c.Assert(current, gc.Equals, controllerName) }