示例#1
0
func (s *BootstrapConfigFileSuite) TestParseControllerMetadataError(c *gc.C) {
	controllers, err := jujuclient.ParseBootstrapConfig([]byte("fail me now"))
	c.Assert(err, gc.ErrorMatches, "cannot unmarshal bootstrap config: yaml: unmarshal errors:\n  line 1: cannot unmarshal !!str `fail me...` into jujuclient.bootstrapConfigCollection")
	c.Assert(controllers, gc.IsNil)
}
示例#2
0
func parseBootstrapConfig(c *gc.C) map[string]jujuclient.BootstrapConfig {
	configs, err := jujuclient.ParseBootstrapConfig([]byte(testBootstrapConfigYAML))
	c.Assert(err, jc.ErrorIsNil)
	return configs
}