Ejemplo n.º 1
0
func (s *GetSuite) TestInit(c *gc.C) {
	// zero or one args is fine.
	err := testing.InitCommand(model.NewGetCommandForTest(s.fake), nil)
	c.Check(err, jc.ErrorIsNil)
	err = testing.InitCommand(model.NewGetCommandForTest(s.fake), []string{"one"})
	c.Check(err, jc.ErrorIsNil)
	// More than one is not allowed.
	err = testing.InitCommand(model.NewGetCommandForTest(s.fake), []string{"one", "two"})
	c.Check(err, gc.ErrorMatches, `unrecognized args: \["two"\]`)
}
Ejemplo n.º 2
0
func (s *GetSuite) run(c *gc.C, args ...string) (*cmd.Context, error) {
	command := model.NewGetCommandForTest(s.fake)
	return testing.RunCommand(c, command, args...)
}