aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/ssh/common_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-12-14 08:53:43 +0000
committerGitHub <noreply@github.com>2023-12-14 08:53:43 +0000
commitc8348a650177cb0fbb9ef3d0551b5a969c6b4ac3 (patch)
treef59862ee69d374794460dbaec154addd7bb794ba /plumbing/transport/ssh/common_test.go
parent952f1baf5e6ffc9e2e143821368944b40fa0bdbf (diff)
parentced1b81e32f971a80e474e9661b9c1b9c96569e7 (diff)
downloadgo-git-c8348a650177cb0fbb9ef3d0551b5a969c6b4ac3.tar.gz
Merge pull request #969 from nodivbyzero/fix-185-setauth-err-check
plumbing: check setAuth error. Fixes #185
Diffstat (limited to 'plumbing/transport/ssh/common_test.go')
-rw-r--r--plumbing/transport/ssh/common_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/plumbing/transport/ssh/common_test.go b/plumbing/transport/ssh/common_test.go
index 4cc2a06..a724936 100644
--- a/plumbing/transport/ssh/common_test.go
+++ b/plumbing/transport/ssh/common_test.go
@@ -206,3 +206,26 @@ func (c *mockSSHConfig) Get(alias, key string) string {
return a[key]
}
+
+type invalidAuthMethod struct {
+}
+
+func (a *invalidAuthMethod) Name() string {
+ return "invalid"
+}
+
+func (a *invalidAuthMethod) String() string {
+ return "invalid"
+}
+
+func (s *SuiteCommon) TestCommandWithInvalidAuthMethod(c *C) {
+ uploadPack := &UploadPackSuite{}
+ uploadPack.SetUpSuite(c)
+ r := &runner{}
+ auth := &invalidAuthMethod{}
+
+ _, err := r.Command("command", uploadPack.newEndpoint(c, "endpoint"), auth)
+
+ c.Assert(err, NotNil)
+ c.Assert(err, ErrorMatches, "invalid auth method")
+}