Example #1
0
// Test if performing a request invokes the EC2s configured
// http.Client
func (s *ClientSuite) TestClientUsed(c *C) {
	transport := &FlaggingRoundTripper{false, http.DefaultTransport}
	instance := ec2.EC2WithClient(s.auth, s.region, &http.Client{Transport: transport})
	testServer.PrepareResponse(200, nil, StartInstancesExample)
	instance.StartInstances("i-10a64379")
	testServer.WaitRequest()
	c.Assert(transport.Transported, Equals, true)
}
Example #2
0
// Test if EC2WithClient returns an EC2
func (s *ClientSuite) TestWithClient(c *C) {
	instance := ec2.EC2WithClient(s.auth, s.region, &http.Client{})
	c.Assert(instance, NotNil)
}