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/broadcast_test.go

38 lines
693 B
Go

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()
broadcastChan, err := client.Broadcast(ctx)
if err != nil {
t.Fatal(err)
}
for b := range broadcastChan {
spew.Dump(b)
}
}