Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Russell committed Jul 22, 2016
1 parent 56005ac commit 0404cc6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/pseudoace/test_schemata.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:use [clojure.test])
(:require
[clj-time.coerce :refer (to-date)]
[clojure.java.io :as io]
[clojure.instant :refer (read-instant-date)]
[datomic.api :as d]
[pseudoace.core :as core]
Expand All @@ -10,10 +11,22 @@

(def db-uri "datomic:mem://wb-test")

(def annotated-models-path "/tmp/latest-annotated-models.wrm")

(defn db-created [test-fn]
(d/create-database db-uri)
(test-fn))

(def annotated-models-uri
(str "https://raw.githubusercontent.com/"
"WormBase/wormbase-pipeline/master/"
"wspec/models.wrm.annot"))

(defn slurp-latest-annotated-models []
(with-open [in (io/input-stream annotated-models-uri)
out (io/output-stream annotated-models-path)]
(io/copy in out)))

(use-fixtures :each db-created)

(defn- check-installed-attr-count
Expand All @@ -37,7 +50,9 @@
(is (<= ltd exp))))

(deftest test-install
(let [main-schema (core/generate-schema)
(slurp-latest-annotated-models)
(let [main-schema (core/generate-schema
:models-filename annotated-models-path)
con (d/connect db-uri)]
(schemata/install con main-schema)
(let [db (d/db con)]
Expand Down

0 comments on commit 0404cc6

Please sign in to comment.