mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-27 21:57:16 +00:00
c309ba6a10
* 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
32 lines
616 B
Go
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())
|
|
}
|
|
}
|