diff options
author | Unknwon <u@gogs.io> | 2016-08-12 02:56:50 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-12 02:56:50 -0700 |
commit | 5be881756b093534462493520eb8f0600235407c (patch) | |
tree | 17ce1707561d69f780d0e79cdc494e4f456827bf /models/ssh_key_test.go | |
parent | 42964272149e2b8f5f3959100c43210cd508e2f5 (diff) | |
download | gitea-5be881756b093534462493520eb8f0600235407c.tar.gz gitea-5be881756b093534462493520eb8f0600235407c.zip |
#3442 add test suites
Diffstat (limited to 'models/ssh_key_test.go')
-rw-r--r-- | models/ssh_key_test.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/models/ssh_key_test.go b/models/ssh_key_test.go index 61f2e18be4..2f7a572c44 100644 --- a/models/ssh_key_test.go +++ b/models/ssh_key_test.go @@ -1,7 +1,12 @@ +// Copyright 2016 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + package models import ( "fmt" + "strings" "testing" . "github.com/smartystreets/goconvey/convey" @@ -37,7 +42,13 @@ func Test_SSHParsePublicKey(t *testing.T) { So(lengthN, ShouldEqual, key.length) keyTypeK, lengthK, errK := SSHKeyGenParsePublicKey(key.content) - So(errK, ShouldBeNil) + if errK != nil { + // Some server just does not support ecdsa format. + if strings.Contains(errK.Error(), "line 1 too long:") { + continue + } + So(errK, ShouldBeNil) + } So(keyTypeK, ShouldEqual, key.typeName) So(lengthK, ShouldEqual, key.length) } |