Browse Source

rename TestClientResubscribes to TestClientSubscribesTwice

test UnsubscribeAll properly
test BufferCapacity getter
pull/1842/head
Anton Kaliaev 7 years ago
parent
commit
77f6febb03
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      pubsub/pubsub_test.go

+ 5
- 3
pubsub/pubsub_test.go View File

@ -68,7 +68,7 @@ func TestDifferentClients(t *testing.T) {
assert.Zero(t, len(ch3))
}
func TestClientResubscribes(t *testing.T) {
func TestClientSubscribesTwice(t *testing.T) {
s := pubsub.NewServer()
s.SetLogger(log.TestingLogger())
s.Start()
@ -125,9 +125,9 @@ func TestUnsubscribeAll(t *testing.T) {
ctx := context.Background()
ch1, ch2 := make(chan interface{}, 1), make(chan interface{}, 1)
err := s.Subscribe(ctx, clientID, query.MustParse("tm.events.type=NewBlock"), ch1)
err := s.Subscribe(ctx, clientID, query.Empty{}, ch1)
require.NoError(t, err)
err = s.Subscribe(ctx, clientID, query.MustParse("tm.events.type=NewBlockHeader"), ch2)
err = s.Subscribe(ctx, clientID, query.Empty{}, ch2)
require.NoError(t, err)
err = s.UnsubscribeAll(ctx, clientID)
@ -148,6 +148,8 @@ func TestBufferCapacity(t *testing.T) {
s := pubsub.NewServer(pubsub.BufferCapacity(2))
s.SetLogger(log.TestingLogger())
assert.Equal(t, 2, s.BufferCapacity())
ctx := context.Background()
err := s.Publish(ctx, "Nighthawk")
require.NoError(t, err)


Loading…
Cancel
Save