Beispiel #1
0
// Test if performing a request invokes the S3s configured
// http.Client
func (s *ClientSuite) TestClientUsed(c *C) {
	transport := &FlaggingRoundTripper{false, http.DefaultTransport}
	instance := s3.S3WithClient(s.auth, s.region, &http.Client{Transport: transport})
	testServer.PrepareResponse(200, nil, "")
	b := instance.Bucket("bucket")
	err := b.PutBucket(s3.Private)
	c.Assert(err, IsNil)
	testServer.WaitRequest()
	c.Assert(transport.Transported, Equals, true)
}
Beispiel #2
0
// Test if S3WithClient returns an S3
func (s *ClientSuite) TestWithClient(c *C) {
	instance := s3.S3WithClient(s.auth, s.region, &http.Client{})
	c.Assert(instance, NotNil)
}