예제 #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")
}
예제 #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")
}
예제 #3
0
func (*connConfigSuite) TestValidateValid(c *gc.C) {
	cfg := google.ConnectionConfig{
		Region:    "spam",
		ProjectID: "eggs",
	}
	err := cfg.Validate()

	c.Check(err, jc.ErrorIsNil)
}