38 lines
543 B
Go
38 lines
543 B
Go
package pluralkit
|
|
|
|
import (
|
|
"net/http"
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/kr/pretty"
|
|
)
|
|
|
|
func mkClient(t *testing.T) Client {
|
|
t.Helper()
|
|
|
|
return New(os.Getenv("PLURALKIT_TOKEN"), http.DefaultClient)
|
|
}
|
|
|
|
func TestPluralKitSystemInfo(t *testing.T) {
|
|
c := mkClient(t)
|
|
|
|
system, err := c.System()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
t.Log(pretty.Sprint(system))
|
|
}
|
|
|
|
func TestSystemByID(t *testing.T) {
|
|
c := mkClient(t)
|
|
|
|
system, err := c.SystemByID(os.Getenv("PLURALKIT_SYSTEM"))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
t.Log(pretty.Sprint(system))
|
|
}
|