linkinfo/imgur_test.go

23 lines
427 B
Go

package linkinfo
import (
"os"
"testing"
)
func TestImgurInfoApi_Handler(t *testing.T) {
api := New(&ImgurOptions{
ClientId: os.Getenv("IMGUR_CLIENT_ID"),
})
info, err := api.Imgur.Handler("https://i.imgur.com/1GKJg79.gifv")
if err != nil {
t.Fatal("Error getting imgur info:", err)
}
if info.Title != "Imgur - Approaching the weekend like (720x404, Animated)" {
t.Fatal("Unexpected title", info.Title)
}
}