Пример #1
0
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")
}
Пример #2
0
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")
}
Пример #3
0
func (s *filesSuite) assertCurrentController(c *gc.C, controllerName string) {
	current, err := envcmd.ReadCurrentController()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(current, gc.Equals, controllerName)
}