Esempio n. 1
0
func (s *UserCommandSuite) TestHelp(c *gc.C) {
	// Check the help output
	ctx, err := testing.RunCommand(c, user.NewSuperCommand(), "--help")
	c.Assert(err, jc.ErrorIsNil)
	namesFound := testing.ExtractCommandsFromHelpOutput(ctx)
	c.Assert(namesFound, gc.DeepEquals, expectedUserCommmandNames)
}
Esempio n. 2
0
func (s *SpaceCommandSuite) TestHelpSubcommandsMVP(c *gc.C) {
	s.BaseSuite.SetFeatureFlags()
	s.BaseSpaceSuite.SetUpTest(c) // looks evil, but works fine

	ctx, err := coretesting.RunCommand(c, s.superCmd, "--help")
	c.Assert(err, jc.ErrorIsNil)

	namesFound := coretesting.ExtractCommandsFromHelpOutput(ctx)
	c.Assert(namesFound, jc.SameContents, mvpSubcommandNames)
}
Esempio n. 3
0
func (s *SubnetCommandSuite) TestHelpSubcommandsPostMVP(c *gc.C) {
	s.BaseSuite.SetFeatureFlags(feature.PostNetCLIMVP)
	s.BaseSubnetSuite.SetUpTest(c) // looks evil, but works fine

	ctx, err := coretesting.RunCommand(c, s.superCmd, "--help")
	c.Assert(err, jc.ErrorIsNil)

	namesFound := coretesting.ExtractCommandsFromHelpOutput(ctx)
	allSubcommandNames := append(mvpSubcommandNames, postMVPSubcommandNames...)
	c.Assert(namesFound, jc.SameContents, allSubcommandNames)
}
Esempio n. 4
0
func getHelpCommandNames(c *gc.C) []string {
	ctx, err := testing.RunCommand(c, environment.NewSuperCommand(), "--help")
	c.Assert(err, jc.ErrorIsNil)
	return testing.ExtractCommandsFromHelpOutput(ctx)
}