Skip to content

Commit

Permalink
Add more errors to request response
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-ogrady committed Sep 14, 2020
1 parent 209dc54 commit dd5277e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/tester/data_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ func (c *CheckDataTests) Print() {
// indicating if all endpoints received
// a non-500 response.
func RequestResponseTest(err error) bool {
return !(fetcher.Err(err) || errors.Is(err, utils.ErrNetworkNotSupported))
return !(fetcher.Err(err) ||
errors.Is(err, utils.ErrNetworkNotSupported) ||
errors.Is(err, syncer.ErrGetNetworkStatusFailed) ||
errors.Is(err, syncer.ErrFetchBlockFailed))
}

// ResponseAssertionTest returns a boolean
Expand Down
14 changes: 14 additions & 0 deletions pkg/tester/data_results_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ func TestComputeCheckDataResults(t *testing.T) {
},
},
},
"default configuration, no storage, syncer and fetch errors": {
cfg: configuration.DefaultConfiguration(),
err: []error{
syncer.ErrGetNetworkStatusFailed,
syncer.ErrFetchBlockFailed,
},
result: &CheckDataResults{
Tests: &CheckDataTests{
RequestResponse: false,
ResponseAssertion: true,
BlockSyncing: &f,
},
},
},
"default configuration, no storage, assertion errors": {
cfg: configuration.DefaultConfiguration(),
err: []error{asserter.ErrAmountValueMissing},
Expand Down

0 comments on commit dd5277e

Please sign in to comment.