streamdeck-obs-replay/slobs/slobs_test.go

35 lines
523 B
Go
Raw Normal View History

2020-01-16 05:19:22 +00:00
package slobs
import (
"log"
"testing"
)
func Test_StreamlabsOBS(t *testing.T) {
c := NewClient("127.0.0.1:59650")
err := c.Connect()
if err != nil {
t.Fatal(err)
}
2020-06-27 20:59:56 +00:00
closeCh := make(chan struct{}, 1)
c.Auth("a", func(err error) {
if err != nil {
t.Fatal(err)
closeCh <- struct{}{}
return
}
c.Subscribe("StreamingService", "replayBufferStatusChange", func(event *ResourceEvent) {
var status string
event.DecodeTo(&status)
log.Println("Event received:", status)
})
2020-01-16 05:19:22 +00:00
})
2020-06-27 20:59:56 +00:00
<-closeCh
2020-01-16 05:19:22 +00:00
}