Files
anubis-mirror/internal/thoth/thoth_test.go
Xe Iaso 315253dce7 feat(thoth): cached ip to asn checker
Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-05-21 11:27:53 -04:00

30 lines
457 B
Go

package thoth
import (
"os"
"testing"
"github.com/joho/godotenv"
)
func loadSecrets(t testing.TB) *Client {
if err := godotenv.Load(); err != nil {
t.Skip(".env not defined, can't load thoth secrets")
}
cli, err := New(t.Context(), os.Getenv("THOTH_URL"), os.Getenv("THOTH_API_KEY"))
if err != nil {
t.Fatal(err)
}
return cli
}
func TestNew(t *testing.T) {
cli := loadSecrets(t)
if err := cli.Close(); err != nil {
t.Fatal(err)
}
}