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) }
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) }
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) }
func getHelpCommandNames(c *gc.C) []string { ctx, err := testing.RunCommand(c, environment.NewSuperCommand(), "--help") c.Assert(err, jc.ErrorIsNil) return testing.ExtractCommandsFromHelpOutput(ctx) }