Пример #1
0
func (s *flagWinSuite) TestEmpty(c *gc.C) {
	s.k.SetStringValue("JUJU_TESTING_FEATURE", "")
	featureflag.SetFlagsFromRegistry(regKey, "JUJU_TESTING_FEATURE")
	c.Assert(featureflag.All(), gc.HasLen, 0)
	c.Assert(featureflag.AsEnvironmentValue(), gc.Equals, "")
	c.Assert(featureflag.String(), gc.Equals, "")
}
Пример #2
0
func (s *flagWinSuite) TestParsing(c *gc.C) {
	s.k.SetStringValue("JUJU_TESTING_FEATURE", "MAGIC, test, space ")
	featureflag.SetFlagsFromRegistry(regKey, "JUJU_TESTING_FEATURE")
	c.Assert(featureflag.All(), jc.SameContents, []string{"magic", "space", "test"})
	c.Assert(featureflag.AsEnvironmentValue(), gc.Equals, "magic,space,test")
	c.Assert(featureflag.String(), gc.Equals, `"magic", "space", "test"`)
}
Пример #3
0
func (s *flagSuite) TestEmpty(c *gc.C) {
	s.PatchEnvironment("JUJU_TESTING_FEATURE", "")
	featureflag.SetFlagsFromEnvironment("JUJU_TESTING_FEATURE")
	c.Assert(featureflag.All(), gc.HasLen, 0)
	c.Assert(featureflag.AsEnvironmentValue(), gc.Equals, "")
	c.Assert(featureflag.String(), gc.Equals, "")
}