tstor/pkg/qbittorrent/log_test.go

40 lines
675 B
Go
Raw Normal View History

2024-08-31 23:00:13 +00:00
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))
}