mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-10 02:28:45 +00:00
30 lines
457 B
Go
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)
|
|
}
|
|
}
|