Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added tests for Rate Limiting support.

  • Loading branch information...
commit ba3c8e8bf4129c99f47966d1593799aa1c3d3900 1 parent 32f36f6
@jeluard jeluard authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/tentacles/core_test.clj
View
13 test/tentacles/core_test.clj
@@ -0,0 +1,13 @@
+(ns tentacles.core-test
+ (:use clojure.test)
+ (:require [tentacles.core :as core]))
+
+(deftest hitting-rate-limit-is-propagated
+ (is (= (:status (core/safe-parse {:status 403}))
+ 403)))
+
+(deftest rate-limit-details-are-propagated-when-defined
+ (is (contains? (core/safe-parse {:status 200 :X-RateLimit-Limit 20 :headers {"content-type" ""}}) :X-RateLimit-Limit)))
+
+(deftest rate-limit-details-are-ignored-when-undefined
+ (is (not (contains? (core/safe-parse {:status 200 :headers {"content-type" ""}}) :X-RateLimit-Limit))))
Please sign in to comment.
Something went wrong with that request. Please try again.