diff options
author | Morlinest <Morlinest@users.noreply.github.com> | 2017-08-28 11:17:45 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-08-28 12:17:45 +0300 |
commit | 8e61823ec403b661359373f8f8b0c9a7c9ea368d (patch) | |
tree | 0ee6d56bf3f1c01348afa2a2f03dfbd6f72815de /models/gpg_key_test.go | |
parent | ced50e0ec13085504fa19c82f018a2eecb70ff68 (diff) | |
download | gitea-8e61823ec403b661359373f8f8b0c9a7c9ea368d.tar.gz gitea-8e61823ec403b661359373f8f8b0c9a7c9ea368d.zip |
Fix tests code to prevent some runtime errors (#2381)
* Fix tests code to prevent some runtime errors
* Reduce nesting
Diffstat (limited to 'models/gpg_key_test.go')
-rw-r--r-- | models/gpg_key_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/gpg_key_test.go b/models/gpg_key_test.go index 687e0cd594..6b34b10760 100644 --- a/models/gpg_key_test.go +++ b/models/gpg_key_test.go @@ -219,6 +219,7 @@ Q0KHb+QcycSgbDx0ZAvdIacuKvBBcbxrsmFUI4LR+oIup0G9gUc0roPvr014jYQL key, err := AddGPGKey(1, testEmailWithUpperCaseLetters) assert.NoError(t, err) - assert.Len(t, key.Emails, 1) - assert.Equal(t, "user1@example.com", key.Emails[0].Email) + if assert.Len(t, key.Emails, 1) { + assert.Equal(t, "user1@example.com", key.Emails[0].Email) + } } |