Skip to content

Commit 030aa9c

Browse files
committed
improve tests
1 parent 10fbd80 commit 030aa9c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

models/gpg_key_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
package models
66

77
import (
8-
"strings"
98
"testing"
109
"time"
1110

1211
"code.gitea.io/gitea/modules/util"
12+
"github.com/keybase/go-crypto/openpgp"
1313

1414
"github.com/stretchr/testify/assert"
1515
)
@@ -408,4 +408,11 @@ FkzJRllII58iAA==
408408
assert.NoError(t, err)
409409

410410
assert.Equal(t, 1, len(ekey.Identities)) //Should not output the revoked uid
411+
412+
//Inspired from https://github.com/keybase/go-crypto/blob/master/openpgp/keys_test.go#L519
413+
var identities []*openpgp.Identity
414+
for _, identity := range ekey.Identities {
415+
identities = append(identities, identity)
416+
}
417+
assert.Contains(t, identities[0].Name, "Alden Peeters <alden.peeters@") //Should not output the revoked uid
411418
}

0 commit comments

Comments
 (0)