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) }
func parseBootstrapConfig(c *gc.C) map[string]jujuclient.BootstrapConfig { configs, err := jujuclient.ParseBootstrapConfig([]byte(testBootstrapConfigYAML)) c.Assert(err, jc.ErrorIsNil) return configs }