From 659f4b961259ecf0764bd93c4f2001c133058418 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Tue, 9 Mar 2010 10:42:05 -0800 Subject: [PATCH] Remove a redundant function, rename a test, add test todo. --- blobstore/src/main/clojure/org/jclouds/blobstore.clj | 12 ------------ .../src/test/clojure/org/jclouds/blobstore_test.clj | 9 +++++---- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/blobstore/src/main/clojure/org/jclouds/blobstore.clj b/blobstore/src/main/clojure/org/jclouds/blobstore.clj index b99c18badf..6388f61f95 100644 --- a/blobstore/src/main/clojure/org/jclouds/blobstore.clj +++ b/blobstore/src/main/clojure/org/jclouds/blobstore.clj @@ -70,18 +70,6 @@ Options can also be specified for extension modules `(binding [*blobstore* (as-blobstore ~@blobstore-or-args)] ~@body)) -(defn- parse-args - "Takes a seq of 'ssh' arguments and returns a map of option keywords - to option values." - [args] - (loop [[arg :as args] args - opts {:cmd [] :out "UTF-8"}] - (if-not args - opts - (if (keyword? arg) - (recur (nnext args) (assoc opts arg (second args))) - (recur (next args) (update-in opts [:cmd] conj arg)))))) - (defn- parse-args "Parses arguments, recognises keywords in the set single as boolean switches." [args single default] diff --git a/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj b/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj index 265e68c45e..0a5fc1ce96 100644 --- a/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj +++ b/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj @@ -7,9 +7,8 @@ (def stub-blobstore (.getBlobStore stub-context)) (defn clean-stub-fixture [f] - (doall - (map - #(.deleteContainer stub-blobstore (.getName %)) (.list stub-blobstore))) + (doseq [container (.list stub-blobstore)] + (.deleteContainer stub-blobstore (.getName container))) (f)) (use-fixtures :each clean-stub-fixture) @@ -32,7 +31,7 @@ (with-blobstore [stub-blobstore] (is (= stub-blobstore *blobstore*)))) -(deftest create-container-test +(deftest create-existing-container-test (is (not (container-exists? stub-blobstore ""))) (with-blobstore [stub-blobstore] (is (not (container-exists? "")))) @@ -79,3 +78,5 @@ (is (= 3 (count (list-container "container")))) (is (= 4 (count (list-container "container" :recursive)))) (is (= 1 (count (list-container "container" :in-directory "dir")))))) + +;; TODO: more tests involving blob-specific functions