prysm-pulse/beacon-chain/operations/attestations/service_test.go
terence tsao c309ba6a10
Applies assertion funcs to operation tests (#6608)
* Update kv aggregated_test.go
* Update block_test.go
* Update forkchoice_test.go
* Update unaggregated_test.go
* Update prepare_forkchoice_test.go
* Update prune_expired_test.go
* Update atts service_test.go
* Update service_attester_test.go
* Update service_proposer_test.go
* Upate exit service_test.go
* Gaz
2020-07-15 18:37:51 +00:00

32 lines
616 B
Go

package attestations
import (
"context"
"errors"
"testing"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
)
func TestStop_OK(t *testing.T) {
s, err := NewService(context.Background(), &Config{})
require.NoError(t, err)
if err := s.Stop(); err != nil {
t.Fatalf("Unable to stop attestation pool service: %v", err)
}
if s.ctx.Err() != context.Canceled {
t.Error("context was not canceled")
}
}
func TestStatus_Error(t *testing.T) {
err := errors.New("bad bad bad")
s := &Service{err: err}
if err := s.Status(); err != s.err {
t.Errorf("Wanted: %v, got: %v", s.err, s.Status())
}
}