   "Suite of tests to verify that a given block store implementation conforms to
   the spec."
   (:require
-    [alphabase.bytes :as bytes]
+    [alphabase.bytes :refer [random-bytes]]
     [alphabase.hex :as hex]
     [blocks.core :as block]
     [blocks.store.util :as util]
+    [byte-streams :as bytes :refer [bytes=]]
     [clojure.java.io :as io]
     [clojure.test :refer :all]
     [clojure.test.check :as check]

  "Creates a new block with random content at most `max-size` bytes long."
  [max-size]
  (block/read!
    (bytes/random-bytes (inc (rand-int max-size)))
    (rand-nth (keys digest/functions))))




    :delete-batch!
      (let [contained-ids (keep (set args) (keys model))]
        (is (= (set contained-ids) result)))

    :open-block
      (if-let [block (get model args)]
        (is (bytes= (.open (.content block)) (block/open result)))
        (is (nil? result)))

    :open-block-range
      (let [[id start end] args]
        (if-let [block (get model id)]
          (is (bytes= (@#'blocks.core/bounded-input-stream
                        (.open (.content block)) start end)
                      (block/open result
                                  (min start (:size block))
                                  (min end   (:size block)))))
          (is (nil? result))))))


(defn- update-model
