Skip to content

Commit

Permalink
fix TestRateLimitRealRapidAPI failure error message and skip it if we…
Browse files Browse the repository at this point in the history
… don't have RapidAPIKEY set
  • Loading branch information
michaelshobbs authored and jbreitbart committed Apr 24, 2020
1 parent cf347ce commit b24292a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rateLimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func TestRateLimitRealRapidAPI(t *testing.T) {
t.Skip("IMGURCLIENTID environment variable not set.")
}
RapidAPIKey := os.Getenv("RapidAPIKEY")
if RapidAPIKey == "" {
t.Skip("RapidAPIKEY environment variable not set.")
}

client := createClient(new(http.Client), key, RapidAPIKey)

Expand All @@ -44,7 +47,7 @@ func TestRateLimitRealRapidAPI(t *testing.T) {
// There seem to be not rate limites when using the payed API
if rl.ClientLimit != 0 || rl.UserLimit != 0 {
client.Log.Debugf("Found ClientLimit: %v and UserLimit: %v", rl.ClientLimit, rl.UserLimit)
t.Error("Client/User limits are wrong. Probably something broken. Or IMGUR changed their limits. Or you are not using a free account for testing. Sorry. No real good way to test this.")
t.Error("Client/User limits are wrong. Probably something broken. Or IMGUR changed their limits. Or you are using a free account for testing. Sorry. No real good way to test this.")
}
}

Expand Down

0 comments on commit b24292a

Please sign in to comment.