Skip to content

Instantly share code, notes, and snippets.

@nlacasse
Created November 14, 2012 00:38
Show Gist options
  • Save nlacasse/4069421 to your computer and use it in GitHub Desktop.
Save nlacasse/4069421 to your computer and use it in GitHub Desktop.
no more transact!s in tests
diff --git a/src/hermes/vertex.clj b/src/hermes/vertex.clj
index 00920e4..111dc29 100644
--- a/src/hermes/vertex.clj
+++ b/src/hermes/vertex.clj
@@ -9,7 +9,7 @@
"Create a vertex, optionally with the given property map."
([] (create! {}))
([data]
- (set-properties! (.addVertex *graph*) data)))
+ (set-properties! (.addVertex *graph* nil) data)))
(defn get-by-id [& ids]
"Retrieves nodes by id from the graph."
diff --git a/test/hermes/vertex_test.clj b/test/hermes/vertex_test.clj
index ae40842..73e3136 100644
--- a/test/hermes/vertex_test.clj
+++ b/test/hermes/vertex_test.clj
@@ -65,18 +65,17 @@
(deftest test-find-by-kv-backed-by-hbase
(g/open conf)
- (g/transact! (t/create-vertex-key-once :age Long {:indexed true}))
- (g/transact!
- (let [v1 (v/create! {:age 1
- :name "A"})
- v2 (v/create! {:age 2
- :name "B"})
- v3 (v/create! {:age 2
- :name "C"})]
- (is (= #{"A"}
- (set (map #(v/get-property % :name) (v/find-by-kv :age 1)))))
- (is (= #{"B" "C"}
- (set (map #(v/get-property % :name) (v/find-by-kv :age 2))))))))
+ (t/create-vertex-key-once :age Long {:indexed true})
+ (let [v1 (v/create! {:age 1
+ :name "A"})
+ v2 (v/create! {:age 2
+ :name "B"})
+ v3 (v/create! {:age 2
+ :name "C"})]
+ (is (= #{"A"}
+ (set (map #(v/get-property % :name) (v/find-by-kv :age 1)))))
+ (is (= #{"B" "C"}
+ (set (map #(v/get-property % :name) (v/find-by-kv :age 2)))))))
(deftest test-upsert!
(g/open)
@@ -100,8 +99,8 @@
(deftest test-upsert!-backed-by-hbase
(g/open conf)
- (g/transact! (t/create-vertex-key-once :first-name String {:indexed true})
- (t/create-vertex-key-once :last-name String {:indexed true}))
+ (t/create-vertex-key-once :first-name String {:indexed true})
+ (t/create-vertex-key-once :last-name String {:indexed true})
(let [v1-a (v/upsert! :first-name
{:first-name "Zack" :last-name "Maril" :test 0})
v1-b (v/upsert! :first-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment