74 lines
1.4 KiB
Go
74 lines
1.4 KiB
Go
|
package qbittorrent
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestClient_Version(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
version, err := c.Application().Version(ctx)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Log(version)
|
||
|
}
|
||
|
|
||
|
func TestClient_WebApiVersion(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
version, err := c.Application().WebApiVersion(ctx)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Log(version)
|
||
|
}
|
||
|
|
||
|
func TestClient_BuildInfo(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
info, err := c.Application().BuildInfo(ctx)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Logf("build: %+v", info)
|
||
|
}
|
||
|
|
||
|
func TestClient_Shutdown(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
if err := c.Application().Shutdown(ctx); err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Log("shutting down")
|
||
|
}
|
||
|
|
||
|
func TestClient_GetPreferences(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
prefs, err := c.Application().GetPreferences(ctx)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Logf("prefs: %+v", prefs)
|
||
|
}
|
||
|
|
||
|
func TestClient_SetPreferences(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
prefs, err := c.Application().GetPreferences(ctx)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
prefs.FileLogAge = 301
|
||
|
if err := c.Application().SetPreferences(ctx, prefs); err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Logf("success")
|
||
|
}
|
||
|
|
||
|
func TestClient_DefaultSavePath(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
path, err := c.Application().DefaultSavePath(ctx)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
t.Logf("path: %s", path)
|
||
|
}
|