-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from uosl/feature/more-ws
More webservices and various fixes
- Loading branch information
Showing
10 changed files
with
200 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
(ns imcljs.bgproperties-test | ||
(:require-macros [cljs.core.async.macros :refer [go]]) | ||
(:require [cljs.test :refer-macros [async deftest testing is]] | ||
[cljs.core.async :refer [<!]] | ||
[imcljs.fetch :as fetch] | ||
[imcljs.save :as save] | ||
[imcljs.env :refer [service]] | ||
[imcljs.auth :as auth] | ||
[clojure.edn :as edn])) | ||
|
||
(def bg-key "ole.dole.doffen") | ||
|
||
(defn read-prop [value] | ||
(edn/read-string value)) | ||
|
||
(defn write-prop [value] | ||
(pr-str value)) | ||
|
||
(deftest bg-properties | ||
(async done | ||
(go | ||
(let [login-response (<! (auth/login service "test_user@mail_account" "secret")) | ||
token (get-in login-response [:output :token]) | ||
service (assoc service :token token)] | ||
(testing "Add new key to bluegenes properties" | ||
(let [value {:foo "bar"} | ||
_save-value (<! (save/bluegenes-properties service bg-key (write-prop value))) | ||
saved (-> (<! (fetch/bluegenes-properties service)) | ||
(get (keyword bg-key)) | ||
(read-prop))] | ||
(is (= value saved)))) | ||
(testing "Update an existing key in bluegenes properties" | ||
(let [value {:foo "baz"} | ||
_update-value (<! (save/update-bluegenes-properties service bg-key (write-prop value))) | ||
updated (-> (<! (fetch/bluegenes-properties service)) | ||
(get (keyword bg-key)) | ||
(read-prop))] | ||
(is (= value updated)))) | ||
(testing "Delete an existing kkey in bluegenes properties" | ||
(let [_delete-value (<! (save/delete-bluegenes-properties service bg-key)) | ||
deleted (-> (<! (fetch/bluegenes-properties service)) | ||
(get (keyword bg-key)) | ||
(read-prop))] | ||
(is (nil? deleted)))) | ||
(done))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters