mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
api/client_test.go: add test for calling Subscribe with nil handler.
This commit is contained in:
parent
e7ad37c38a
commit
bcd4a93c46
1 changed files with 11 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/eosswedenorg/thalos/api/message"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type mockReader struct{}
|
||||
|
|
@ -48,3 +49,13 @@ func TestClient_Subscribe(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestClient_SubscribeWithNilHandler(t *testing.T) {
|
||||
client := NewClient(nil, nil)
|
||||
client.OnAction = mockActionHandler
|
||||
client.OnHeartbeat = mockHbHandler
|
||||
|
||||
err := client.Subscribe(TableDeltaChannel{Name: "name"}.Channel())
|
||||
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue