From 5642c3e463b246197f7019a0eaae2441b36843ef Mon Sep 17 00:00:00 2001 From: Ian Booth Date: Tue, 13 May 2014 14:09:45 +1000 Subject: [PATCH] Fix compile error in test --- http/client_test.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/http/client_test.go b/http/client_test.go index 3616ed9..55d2f7e 100644 --- a/http/client_test.go +++ b/http/client_test.go @@ -52,6 +52,17 @@ type LoopingHTTPSuite struct { creds *auth.Credentials } +func (s *LoopingHTTPSuite) SetUpSuite(c *gc.C) { + s.HTTPSuite.SetUpSuite(c) + authCreds, err := auth.NewAuth("test_user", key, "rsa-sha256") + c.Assert(err, gc.IsNil) + s.creds = &auth.Credentials{ + UserAuthentication: authCreds, + SdcKeyId: "test_key", + SdcEndpoint: auth.Endpoint{URL: "http://gotest.api.joyentcloud.com"}, + } +} + func (s *LoopingHTTPSuite) setupLoopbackRequest() (*http.Header, chan string, *Client) { var headers http.Header bodyChan := make(chan string, 1) @@ -78,16 +89,8 @@ type HTTPSClientTestSuite struct { LoopingHTTPSuite } -var _ = gc.Suite(&HTTPClientTestSuite{LoopingHTTPSuite{httpsuite.HTTPSuite{}, &auth.Credentials{ - UserAuthentication: auth.Auth{User: "test_user", PrivateKey: key, Algorithm: "rsa-sha256"}, - SdcKeyId: "test_key", - SdcEndpoint: auth.Endpoint{URL: "http://gotest.api.joyentcloud.com"}, -}}}) -var _ = gc.Suite(&HTTPSClientTestSuite{LoopingHTTPSuite{httpsuite.HTTPSuite{UseTLS: true}, &auth.Credentials{ - UserAuthentication: auth.Auth{User: "test_user", PrivateKey: key, Algorithm: "rsa-sha256"}, - SdcKeyId: "test_key", - SdcEndpoint: auth.Endpoint{URL: "http://gotest.api.joyentcloud.com"}, -}}}) +var _ = gc.Suite(&HTTPClientTestSuite{}) +var _ = gc.Suite(&HTTPSClientTestSuite{}) func (s *HTTPClientTestSuite) assertHeaderValues(c *gc.C, apiVersion string) { emptyHeaders := http.Header{}