mirror of https://github.com/apache/jclouds.git
Remove a redundant function, rename a test, add test todo.
This commit is contained in:
parent
bdba469580
commit
659f4b9612
|
@ -70,18 +70,6 @@ Options can also be specified for extension modules
|
||||||
`(binding [*blobstore* (as-blobstore ~@blobstore-or-args)]
|
`(binding [*blobstore* (as-blobstore ~@blobstore-or-args)]
|
||||||
~@body))
|
~@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
|
(defn- parse-args
|
||||||
"Parses arguments, recognises keywords in the set single as boolean switches."
|
"Parses arguments, recognises keywords in the set single as boolean switches."
|
||||||
[args single default]
|
[args single default]
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
(def stub-blobstore (.getBlobStore stub-context))
|
(def stub-blobstore (.getBlobStore stub-context))
|
||||||
|
|
||||||
(defn clean-stub-fixture [f]
|
(defn clean-stub-fixture [f]
|
||||||
(doall
|
(doseq [container (.list stub-blobstore)]
|
||||||
(map
|
(.deleteContainer stub-blobstore (.getName container)))
|
||||||
#(.deleteContainer stub-blobstore (.getName %)) (.list stub-blobstore)))
|
|
||||||
(f))
|
(f))
|
||||||
|
|
||||||
(use-fixtures :each clean-stub-fixture)
|
(use-fixtures :each clean-stub-fixture)
|
||||||
|
@ -32,7 +31,7 @@
|
||||||
(with-blobstore [stub-blobstore]
|
(with-blobstore [stub-blobstore]
|
||||||
(is (= stub-blobstore *blobstore*))))
|
(is (= stub-blobstore *blobstore*))))
|
||||||
|
|
||||||
(deftest create-container-test
|
(deftest create-existing-container-test
|
||||||
(is (not (container-exists? stub-blobstore "")))
|
(is (not (container-exists? stub-blobstore "")))
|
||||||
(with-blobstore [stub-blobstore]
|
(with-blobstore [stub-blobstore]
|
||||||
(is (not (container-exists? ""))))
|
(is (not (container-exists? ""))))
|
||||||
|
@ -79,3 +78,5 @@
|
||||||
(is (= 3 (count (list-container "container"))))
|
(is (= 3 (count (list-container "container"))))
|
||||||
(is (= 4 (count (list-container "container" :recursive))))
|
(is (= 4 (count (list-container "container" :recursive))))
|
||||||
(is (= 1 (count (list-container "container" :in-directory "dir"))))))
|
(is (= 1 (count (list-container "container" :in-directory "dir"))))))
|
||||||
|
|
||||||
|
;; TODO: more tests involving blob-specific functions
|
||||||
|
|
Loading…
Reference in New Issue