File size: 453 Bytes
7107f0b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
package rpc
import (
"context"
"testing"
"time"
)
func TestWebsocketCaller(t *testing.T) {
time.Sleep(time.Second)
c, err := newWebsocketCaller(context.Background(), "ws://localhost:6800/jsonrpc", time.Second, &DummyNotifier{})
if err != nil {
t.Fatal(err.Error())
}
defer c.Close()
var info VersionInfo
if err := c.Call(aria2GetVersion, []interface{}{}, &info); err != nil {
t.Error(err.Error())
} else {
println(info.Version)
}
}
|