Example #1
0
func (*connConfigSuite) TestValidateMissingRegion(c *gc.C) {
	cfg := google.ConnectionConfig{
		ProjectID: "eggs",
	}
	err := cfg.Validate()

	c.Assert(err, gc.FitsTypeOf, &google.InvalidConfigValue{})
	c.Check(err.(*google.InvalidConfigValue).Key, gc.Equals, "GCE_REGION")
}
Example #2
0
func (*connConfigSuite) TestValidateMissingProjectID(c *gc.C) {
	cfg := google.ConnectionConfig{
		Region: "spam",
	}
	err := cfg.Validate()

	c.Assert(err, gc.FitsTypeOf, &google.InvalidConfigValue{})
	c.Check(err.(*google.InvalidConfigValue).Key, gc.Equals, "GCE_PROJECT_ID")
}
Example #3
0
func (*connConfigSuite) TestValidateValid(c *gc.C) {
	cfg := google.ConnectionConfig{
		Region:    "spam",
		ProjectID: "eggs",
	}
	err := cfg.Validate()

	c.Check(err, jc.ErrorIsNil)
}