Small enhancements to blobstore2_test.

Made each test clause insert a uniquely named blob, to reduce risk that an
earlier correct result masquerades as a success in a later clause.
This commit is contained in:
David Santiago 2011-04-21 11:32:42 -05:00
parent cea0e7d7ad
commit 6152de91c5
1 changed files with 12 additions and 12 deletions

View File

@ -169,26 +169,26 @@
:payload "blob1")) :payload "blob1"))
(Strings2/toStringAndClose (get-blob-stream *blobstore* (Strings2/toStringAndClose (get-blob-stream *blobstore*
"container" "blob1"))))) "container" "blob1")))))
(is (= "blob1" (is (= "blob2"
(do (do
(put-blob *blobstore* "container" (put-blob *blobstore* "container"
(blob "blob1" (blob "blob2"
:payload (StringBufferInputStream. "blob1"))) :payload (StringBufferInputStream. "blob2")))
(Strings2/toStringAndClose (get-blob-stream *blobstore* (Strings2/toStringAndClose (get-blob-stream *blobstore*
"container" "blob1"))))) "container" "blob2")))))
(is (= "blob1" (is (= "blob3"
(do (do
(put-blob *blobstore* "container" (put-blob *blobstore* "container"
(blob "blob1" (blob "blob3"
:payload (.getBytes "blob1"))) :payload (.getBytes "blob3")))
(Strings2/toStringAndClose (get-blob-stream *blobstore* (Strings2/toStringAndClose (get-blob-stream *blobstore*
"container" "blob1"))))) "container" "blob3")))))
(is (= "blob1" (is (= "blob4"
(do (do
(put-blob *blobstore* "container" (put-blob *blobstore* "container"
(blob "blob1" (blob "blob4"
:payload #(.write % (.getBytes "blob1")))) :payload #(.write % (.getBytes "blob4"))))
(Strings2/toStringAndClose (get-blob-stream *blobstore* (Strings2/toStringAndClose (get-blob-stream *blobstore*
"container" "blob1")))))) "container" "blob4"))))))
;; TODO: more tests involving blob-specific functions ;; TODO: more tests involving blob-specific functions