Example #1
0
func (s *ListSuite) TestUnrecognizedArg(c *gc.C) {
	_, err := testing.RunCommand(c, controller.NewListCommandForTest(s.store), "whoops")
	c.Assert(err, gc.ErrorMatches, `unrecognized args: \["whoops"\]`)
}
Example #2
0
func (s *ListSuite) TestListSystemsError(c *gc.C) {
	s.store = errorStore{err: errors.New("cannot read info")}
	_, err := testing.RunCommand(c, controller.NewListCommandForTest(s.store))
	c.Assert(err, gc.ErrorMatches, "failed to list controllers in config store: cannot read info")
}
Example #3
0
func (s *ListSuite) TestControllerList(c *gc.C) {
	context, err := testing.RunCommand(c, controller.NewListCommandForTest(s.store))
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(testing.Stdout(context), gc.Equals, "test1\ntest3\n")
}