From 8e61823ec403b661359373f8f8b0c9a7c9ea368d Mon Sep 17 00:00:00 2001 From: Morlinest Date: Mon, 28 Aug 2017 11:17:45 +0200 Subject: Fix tests code to prevent some runtime errors (#2381) * Fix tests code to prevent some runtime errors * Reduce nesting --- models/gpg_key_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'models/gpg_key_test.go') 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) + } } -- cgit v1.2.3