21 lines
400 B
Go
21 lines
400 B
Go
package hpds_node
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestAccessPointSendDataToServer(t *testing.T) {
|
|
ap := NewAccessPoint("test-ap")
|
|
defer ap.Close()
|
|
|
|
// 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)
|
|
}
|