green pubsub tests :OK:

This commit is contained in:
Anton Kaliaev
2019-01-29 18:46:59 +04:00
parent 11e36d0bfb
commit 7268ec8d10
5 changed files with 241 additions and 166 deletions

View File

@ -19,10 +19,9 @@ func TestExample(t *testing.T) {
defer s.Stop()
ctx := context.Background()
ch := make(chan interface{}, 1)
err := s.Subscribe(ctx, "example-client", query.MustParse("abci.account.name='John'"), ch)
subscription, err := s.Subscribe(ctx, "example-client", query.MustParse("abci.account.name='John'"), 1)
require.NoError(t, err)
err = s.PublishWithTags(ctx, "Tombstone", pubsub.NewTagMap(map[string]string{"abci.account.name": "John"}))
require.NoError(t, err)
assertReceive(t, "Tombstone", ch)
assertReceive(t, "Tombstone", subscription.Out())
}