summaryrefslogtreecommitdiff
path: root/go/internal/command/uploadpack/uploadpack_test.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-10-17 12:04:52 +0100
committerNick Thomas <nick@gitlab.com>2019-10-18 11:47:25 +0100
commit83d11f4deeb20b852a0af3433190a0f7250a0027 (patch)
tree1a9df18d6f9f59712c6f5c98e995a4918eb94a11 /go/internal/command/uploadpack/uploadpack_test.go
parent7d5229db263a62661653431881bef8b46984d0de (diff)
downloadgitlab-shell-83d11f4deeb20b852a0af3433190a0f7250a0027.tar.gz
Move go code up one level
Diffstat (limited to 'go/internal/command/uploadpack/uploadpack_test.go')
-rw-r--r--go/internal/command/uploadpack/uploadpack_test.go31
1 files changed, 0 insertions, 31 deletions
diff --git a/go/internal/command/uploadpack/uploadpack_test.go b/go/internal/command/uploadpack/uploadpack_test.go
deleted file mode 100644
index 27a0786..0000000
--- a/go/internal/command/uploadpack/uploadpack_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package uploadpack
-
-import (
- "bytes"
- "testing"
-
- "github.com/stretchr/testify/require"
-
- "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/commandargs"
- "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/readwriter"
- "gitlab.com/gitlab-org/gitlab-shell/go/internal/config"
- "gitlab.com/gitlab-org/gitlab-shell/go/internal/gitlabnet/testserver"
- "gitlab.com/gitlab-org/gitlab-shell/go/internal/testhelper/requesthandlers"
-)
-
-func TestForbiddenAccess(t *testing.T) {
- requests := requesthandlers.BuildDisallowedByApiHandlers(t)
- url, cleanup := testserver.StartHttpServer(t, requests)
- defer cleanup()
-
- output := &bytes.Buffer{}
-
- cmd := &Command{
- Config: &config.Config{GitlabUrl: url},
- Args: &commandargs.Shell{GitlabKeyId: "disallowed", SshArgs: []string{"git-upload-pack", "group/repo"}},
- ReadWriter: &readwriter.ReadWriter{ErrOut: output, Out: output},
- }
-
- err := cmd.Execute()
- require.Equal(t, "Disallowed by API call", err.Error())
-}