hpds_node/ap_test.go

23 lines
420 B
Go
Raw Normal View History

2022-10-12 11:55:36 +08:00
package hpds_node
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestAccessPointSendDataToServer(t *testing.T) {
ap := NewAccessPoint("test-ap")
defer func() {
_ = ap.Close()
}()
2022-10-12 11:55:36 +08:00
// connect to server
err := ap.Connect()
assert.Nil(t, err)
// send data to server
n, err := ap.Write([]byte("test"))
assert.Greater(t, n, 0, "[ap.Write] expected n > 0, but got %d", n)
assert.Nil(t, err)
}