Fixes incorrect checks for errors in several tests (#7392)

* fixes TestServer_ListAssignments_Pagination_InputOutOfRange
* fixes TestServer_ListValidatorBalances_PaginationOutOfRange
* fix TestServer_ListAttestations_Genesis
* remove redundant TestServer_GetValidatorParticipation_DoesntExist and TestGetDuties_NextEpoch_CantFindValidatorIdx
* Merge branch 'master' into fix-invalid-errcheck-tests
* remove unnecessary import
* fix TestStore_OnAttestation
* fix TestStore_OnAttestationUsingCheckptCache
* fix TestVerifyBlkDescendant
* fix pagination tests
* fix account v2 tests
* fix account v2 tests (remote)
* fix TestServer_JWTInterceptor_BadToken
* Merge refs/heads/master into fix-invalid-errcheck-tests
This commit is contained in:
Victor Farazdagi
2020-10-01 17:38:53 +03:00
committed by GitHub
parent 4aea039324
commit 95a5b4945b
12 changed files with 126 additions and 252 deletions

View File

@@ -110,8 +110,8 @@ func TestDecrypt(t *testing.T) {
// We capture the results of stdout to check the public key and private keys
// were both printed to stdout.
assert.Equal(t, strings.Contains(stringOutput, keystore.Pubkey), true)
assert.Equal(t, strings.Contains(stringOutput, fmt.Sprintf("%#x", privKey.Marshal())), true)
assert.Equal(t, true, strings.Contains(stringOutput, keystore.Pubkey))
assert.Equal(t, true, strings.Contains(stringOutput, fmt.Sprintf("%#x", privKey.Marshal())))
}
func TestEncrypt(t *testing.T) {
@@ -143,9 +143,6 @@ func TestEncrypt(t *testing.T) {
stringOutput := string(out)
// We capture the results of stdout to check the public key was printed to stdout.
assert.Equal(
t,
strings.Contains(stringOutput, fmt.Sprintf("%x", privKey.PublicKey().Marshal())),
true,
)
res := strings.Contains(stringOutput, fmt.Sprintf("%x", privKey.PublicKey().Marshal()))
assert.Equal(t, true, res)
}