Permalink
Browse files

Add more varied tests

  • Loading branch information...
mrgordon committed Jun 10, 2012
1 parent 7047797 commit b9f0e11bf25660744fd16d930af35a03d689d5b9
Showing with 8 additions and 6 deletions.
  1. +8 −6 test/rotary/test/client.clj
@@ -10,6 +10,8 @@
; hash-key 22, range-key 1339202640
; hash-key 25, range-key 1339202645
+(def value1 13392)
+
(deftest query-with-range-key-can-find-rows
(is (count (query aws-credential test-table 25 `(> 1339))) 1))
@@ -20,7 +22,7 @@
(is (count (query aws-credential test-table 22 `(> 1339202642))) 1))
(deftest query-with-range-key-can-handle-less-than
- (is (count (query aws-credential test-table 22 `(< 1339202642))) 1))
+ (is (count (query aws-credential test-table 22 [:< 1339202642])) 1))
(deftest query-with-range-key-less-than
(is (count (query aws-credential test-table 22 `(< 1339202640))) 0))
@@ -29,16 +31,16 @@
(is (query aws-credential test-table 22 `(<= 1339202640) {:count true}) 1))
(deftest query-with-range-key-can-handle-greater-than-with-multiple-items
- (is (query aws-credential test-table 22 `(> 13392) {:count true}) 2))
+ (is (query aws-credential test-table 22 `(> ~value1) {:count true}) 2))
(deftest query-with-range-key-can-handle-greater-than-with-multiple-items-and-limit
- (is (query aws-credential test-table 22 `(> 13392) {:count true :limit 1}) 1))
+ (is (query aws-credential test-table 22 `(> ~value1) {:count true :limit 1}) 1))
(deftest query-with-range-key-can-exclude-with-between
- (is (count (query aws-credential test-table 22 `("BETWEEN" 13392 13399))) 0))
+ (is (count (query aws-credential test-table 22 `(between ~value1 13399))) 0))
(deftest query-with-range-key-can-include-with-between
- (is (count (query aws-credential test-table 22 `("BETWEEN" 13392 999999999))) 2))
+ (is (count (query aws-credential test-table 22 `(between ~value1 999999999))) 2))
(deftest query-with-range-key-can-include-and-exclude-with-between
- (is (count (query aws-credential test-table 22 `("BETWEEN" 13392 1339202643))) 1))
+ (is (count (query aws-credential test-table 22 [:between value1 1339202643])) 1))

0 comments on commit b9f0e11

Please sign in to comment.