18947: Refactor arv-git-httpd as an arvados-server subcommand.
[arvados.git] / services / githttpd / git_handler_test.go
similarity index 94%
rename from services/arv-git-httpd/git_handler_test.go
rename to services/githttpd/git_handler_test.go
index dafe5d31d7f3b3c0dc49145a6232653ef0c075a5..ef2ee28e799ded26b68aaba6eafca6ca564bd35d 100644 (file)
@@ -2,9 +2,10 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-package main
+package githttpd
 
 import (
+       "context"
        "net/http"
        "net/http/httptest"
        "net/url"
@@ -42,7 +43,7 @@ func (s *GitHandlerSuite) TestEnvVars(c *check.C) {
                URL:        u,
                RemoteAddr: "[::1]:12345",
        }
-       h := newGitHandler(s.cluster)
+       h := newGitHandler(context.Background(), s.cluster)
        h.(*gitHandler).Path = "/bin/sh"
        h.(*gitHandler).Args = []string{"-c", "printf 'Content-Type: text/plain\r\n\r\n'; env"}
 
@@ -67,7 +68,7 @@ func (s *GitHandlerSuite) TestCGIErrorOnSplitHostPortError(c *check.C) {
                URL:        u,
                RemoteAddr: "test.bad.address.missing.port",
        }
-       h := newGitHandler(s.cluster)
+       h := newGitHandler(context.Background(), s.cluster)
        h.ServeHTTP(resp, req)
        c.Check(resp.Code, check.Equals, http.StatusInternalServerError)
        c.Check(resp.Body.String(), check.Equals, "")