func (s *AmazonClientSuite) SetUpSuite(c *C) { if !*amazon { c.Skip("live tests against AWS disabled (no -amazon)") } s.srv.SetUp(c) s.s3 = s3.New(s.srv.auth, s.Region) }
func (s *AmazonDomainClientSuite) SetUpSuite(c *C) { if !*amazon { c.Skip("live tests against AWS disabled (no -amazon)") } s.srv.SetUp(c) region := s.Region // TODO(dfc) this subsitution only works for us-east-1 region.S3BucketEndpoint = "https://${bucket}.s3.amazonaws.com" s.s3 = s3.New(s.srv.auth, region) }
// Communicate with all endpoints to see if they are alive. func (s *ClientTests) TestRegions(c *C) { name := s.unique("goamz-region-test") errs := make(chan error, len(aws.Regions)) for _, region := range aws.Regions { go func(r aws.Region) { s := s3.New(s.s3.Auth, r) _, err := s.Bucket(name).Get("non-existent") errs <- err }(region) } for _ = range aws.Regions { err := <-errs if err != nil { s3_err, ok := err.(*s3.Error) if ok { c.Check(s3_err.Code, Matches, "NoSuchBucket") } else { c.Errorf("Non-S3 error: %s", err) } } else { c.Errorf("Test should have errored but it seems to have succeeded") } } }
func (s *S) SetUpSuite(c *C) { s.HTTPSuite.SetUpSuite(c) auth := aws.Auth{"abc", "123"} s.s3 = s3.New(auth, aws.Region{Name: "faux-region-1", S3Endpoint: testServer.URL}) }