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