func (m *localMantaServer) setupServer(c *gc.C) { // Set up the HTTP server. m.Server = httptest.NewServer(nil) c.Assert(m.Server, gc.NotNil) m.oldHandler = m.Server.Config.Handler m.Mux = http.NewServeMux() m.Server.Config.Handler = m.Mux m.manta = lm.New(m.Server.URL, testUser) m.manta.SetupHTTP(m.Mux) c.Logf("Started local Manta service at: %v", m.Server.URL) }
func (s *LocalTests) SetUpSuite(c *gc.C) { // Set up the HTTP server. s.Server = httptest.NewServer(nil) s.oldHandler = s.Server.Config.Handler s.Mux = http.NewServeMux() s.Server.Config.Handler = s.Mux // Set up a Joyent Manta service. authentication := auth.Auth{User: "******", KeyFile: localKeyFile, Algorithm: "rsa-sha256"} s.creds = &auth.Credentials{ UserAuthentication: authentication, MantaKeyId: "", MantaEndpoint: auth.Endpoint{URL: s.Server.URL}, } s.manta = localmanta.New(s.creds.MantaEndpoint.URL, s.creds.UserAuthentication.User) s.manta.SetupHTTP(s.Mux) }
func (s *LocalTests) SetUpSuite(c *gc.C) { // Set up the HTTP server. s.Server = httptest.NewServer(nil) s.oldHandler = s.Server.Config.Handler s.Mux = httprouter.New() s.Server.Config.Handler = s.Mux // Set up a Joyent Manta service. authentication, err := auth.NewAuth("localtest", string(privateKey), "rsa-sha256") c.Assert(err, gc.IsNil) s.creds = &auth.Credentials{ UserAuthentication: authentication, MantaKeyId: "", MantaEndpoint: auth.Endpoint{URL: s.Server.URL}, } s.manta = localmanta.New(s.creds.MantaEndpoint.URL, s.creds.UserAuthentication.User) s.manta.SetupHTTP(s.Mux) }
func (s *MantaHTTPSuite) SetUpSuite(c *gc.C) { s.HTTPSuite.SetUpSuite(c) c.Assert(s.Server.URL[:7], gc.Equals, "http://") s.service = lm.New(s.Server.URL, "fakeuser") }
func (s *MantaSuite) SetUpSuite(c *gc.C) { s.service = lm.New(testServiceURL, testUserAccount) }