This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
orion/emlid/reachview/status_broadcast_test.go

40 lines
691 B
Go
Raw Normal View History

2018-10-16 19:07:35 +02:00
package reachview
import (
"context"
"testing"
"time"
"forge.cadoles.com/Pyxis/orion/emlid"
"github.com/davecgh/go-spew/spew"
)
func TestReachViewStatusBroadcast(t *testing.T) {
if !*runReachViewIntegrationTests {
t.Skip("To run this test, use: go test -reachview-integration")
}
client := NewClient(
emlid.WithStandardLogger(),
emlid.WithEndpoint(*reachHost, 80),
)
if err := client.Connect(); err != nil {
t.Fatal(err)
}
defer client.Close()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
statuses, err := client.StatusBroadcast(ctx)
if err != nil {
t.Fatal(err)
}
for s := range statuses {
spew.Dump(s)
}
}