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.
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()
|
|
|
|
|
2020-11-26 17:00:13 +01:00
|
|
|
broadcastChan, err := client.Broadcast(ctx)
|
2018-10-16 19:07:35 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2020-11-26 17:00:13 +01:00
|
|
|
for b := range broadcastChan {
|
|
|
|
spew.Dump(b)
|
2018-10-16 19:07:35 +02:00
|
|
|
}
|
|
|
|
}
|