23 lines
351 B
Go
23 lines
351 B
Go
package hpds_node
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestSfConnectToServer(t *testing.T) {
|
|
sf := NewStreamFunction(
|
|
"test-sf",
|
|
WithMqAddr("localhost:9000"),
|
|
WithObserveDataTags(0x33),
|
|
)
|
|
defer sf.Close()
|
|
|
|
// set handler
|
|
_ = sf.SetHandler(nil)
|
|
|
|
// connect to server
|
|
err := sf.Connect()
|
|
assert.Nil(t, err)
|
|
}
|