Beispiel #1
0
func (s *LoginSuite) TestWritesCurrentSystem(c *gc.C) {
	_, err := s.runServerFile(c)
	c.Assert(err, jc.ErrorIsNil)
	currentSystem, err := envcmd.ReadCurrentSystem()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(currentSystem, gc.Equals, "foo")
}
Beispiel #2
0
func (s *SwitchSimpleSuite) TestSettingWritesSystemFile(c *gc.C) {
	s.addTestSystem(c)
	context, err := testing.RunCommand(c, &SwitchCommand{}, "a-system")
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(testing.Stderr(context), gc.Equals, "-> a-system (system)\n")
	currSystem, err := envcmd.ReadCurrentSystem()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(currSystem, gc.Equals, "a-system")
}
Beispiel #3
0
func (s *filesSuite) assertCurrentSystem(c *gc.C, systemName string) {
	current, err := envcmd.ReadCurrentSystem()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(current, gc.Equals, systemName)
}