Ubuntu Pastebin

Paste from Anastasia at Thu, 22 Jan 2015 00:40:22 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
	// Check that we have correctly registered all the commands
	// by checking the help output.
	// First check default commands, and then check commands that are
	// activated by feature flags.
	devFeatures := []string{action.FeatureFlag, storage.FeatureFlag}

	// remove features behind dev_flag for the first test
	// since they are not enabled.
	cmdSet := set.NewStrings(commandNames...)
	for _, feature := range devFeatures {
		cmdSet.Remove(feature)
	}

	// 1. Default Commands. Disable all features.
	setFeatureFlags("")
	c.Assert(getHelpCommandNames(c), jc.SameContents, cmdSet.Values())

	// 2. Enable development features, and test again.
	setFeatureFlags(strings.Join(devFeatures, ","))
	c.Assert(getHelpCommandNames(c), jc.SameContents, commandNames)
Download as text