예제 #1
0
func TestBuildCorrectURI(t *testing.T) {
	svc := route53.New(nil)
	req, _ := svc.GetHostedZoneRequest(&route53.GetHostedZoneInput{
		ID: aws.String("/hostedzone/ABCDEFG"),
	})

	req.Build()

	utilassert.Match(t, `\/hostedzone\/ABCDEFG$`, req.HTTPRequest.URL.String())
}
func TestErrorHandling(t *testing.T) {
	client := ec2.New(nil)
	resp, e := client.DescribeInstances(&ec2.DescribeInstancesInput{
		InstanceIDs: []*string{
			aws.String("i-12345678"),
		},
	})
	err := aws.Error(e)
	_, _, _ = resp, e, err // avoid unused warnings

	assert.NotEqual(t, nil, err)
	assert.Equal(t, "InvalidInstanceID.NotFound", err.Code)
	utilassert.Match(t, "The instance ID 'i-12345678' does not exist", err.Message)

}