39 lines
675 B
Go
39 lines
675 B
Go
package qbittorrent
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"testing"
|
|
)
|
|
|
|
func TestClient_GetLog(t *testing.T) {
|
|
ctx := context.Background()
|
|
entries, err := c.Log().GetLog(ctx, &LogOption{
|
|
Normal: true,
|
|
Info: true,
|
|
Warning: true,
|
|
Critical: true,
|
|
LastKnownId: 0,
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
bytes, err := json.Marshal(entries)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(string(bytes))
|
|
}
|
|
|
|
func TestClient_GetPeerLog(t *testing.T) {
|
|
ctx := context.Background()
|
|
entries, err := c.Log().GetPeerLog(ctx, -1)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
bytes, err := json.Marshal(entries)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(string(bytes))
|
|
}
|