                first
                ba->s))))
 
-  (testing "Update val case"
+  (test/testing "Update val case"
     (tundra/put-key dstore (tkey :foo) (s->ba "hello world 1"))
     (tundra/put-key dstore (tkey :foo) (s->ba "hello world 2"))
     (is (= "hello world 2"

               first
               ba->s))))

  (testing "Exception Case"
    (is (thrown? AmazonS3Exception
                 (first (tundra/fetch-keys dstore [(tkey :invalid)]))))))


(deftest tundra-api-test-1
  (let [tstore (tundra/tundra-store dstore)]
    (testing "Bad cases"
      (is (thrown? Exception (wcar* (tundra/dirty tstore (tkey :invalid)))))
      (is (= nil (wcar* (tundra/ensure-ks tstore (tkey :invalid)))))
      (is (thrown? Exception
                   (wcar* (car/sadd @#'tundra/k-evictable (tkey :invalid-evictable))
                          (tundra/ensure-ks tstore (tkey :invalid-evictable))))))

    (testing "API never pollutes enclosing pipeline"
      (is (= ["OK" "PONG" 1]
             (wcar* (car/set (tkey 0) "0")
                    (car/ping)

(ns taoensso.carmine.tests.tundra
  (:require
   [clojure.test     :as test :refer [is deftest]]
   [taoensso.carmine :as car  :refer [wcar]]
   [taoensso.carmine.message-queue :as mq]
   [taoensso.carmine.tundra        :as tundra]
   [taoensso.carmine.tundra.disk   :as tdisk]))

(comment
  (remove-ns      'taoensso.carmine.tests.tundra)
  (test/run-tests 'taoensso.carmine.tests.tundra))

(defmacro wcar* [& body] `(car/wcar {} ~@body))
(def tkey (partial car/key :carmine :tundra :test))
(def tqname "carmine-tundra-tests")
(def mqname (format "tundra:%s" (name tqname))) ; Nb has prefix

(defn clean-up! []
  (mq/clear-queues {} mqname)
