func (s *S) TestEnvAuthAlt(c *check.C) { os.Clearenv() os.Setenv("AWS_SECRET_KEY", "secret") os.Setenv("AWS_ACCESS_KEY", "access") auth, err := aws.EnvAuth() c.Assert(err, check.IsNil) c.Assert(auth, check.Equals, aws.Auth{SecretKey: "secret", AccessKey: "access"}) }
func (s *SuiteI) SetUpSuite(c *check.C) { if !*integration { c.Skip("Integration tests not enabled (-i flag)") } auth, err := aws.EnvAuth() if err != nil { c.Fatal(err.Error()) } s.auth = auth }
func (s *S) TestEnvAuthNoAccess(c *check.C) { os.Clearenv() os.Setenv("AWS_SECRET_ACCESS_KEY", "foo") _, err := aws.EnvAuth() c.Assert(err, check.ErrorMatches, "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment") }
func (s *S) TestEnvAuthNoSecret(c *check.C) { os.Clearenv() _, err := aws.EnvAuth() c.Assert(err, check.ErrorMatches, "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment") }