File tree Expand file tree Collapse file tree 3 files changed +40
-7
lines changed
Expand file tree Collapse file tree 3 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 22 :description " Improve seamlessness of Clojure Jython interop."
33 :dependencies [[org.clojure/clojure " 1.3.0" ]
44 [org.python/jython-standalone " 2.5.2" ]]
5- :main clojure-python.core )
5+ :dev-dependencies [[midje " 1.3.0-RC4" ]]
6+ :main clojure-python.core )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ (ns clojure-python.t-core
2+ (:use midje.sweet)
3+ (:require [clojure-python.core :as base]))
4+
5+ (fact " append-paths adds the path to system path"
6+ (binding [base/*interp* (org.python.util.PythonInterpreter. )]
7+ (-> (#'base/append-paths! [" test/clojure_python/" ])
8+ .getLocals
9+ (.__getitem__ " sys" )
10+ .path
11+ set
12+ (get " test/clojure_python/" )))
13+ =>
14+ " test/clojure_python/" )
15+
16+ (fact " init sets *interp* root binding (but only once)"
17+ (do
18+ (base/init {:libpaths [" test/clojure_python/" ]})
19+ (class base/*interp*))
20+ =>
21+ org.python.util.PythonInterpreter
22+
23+ (do
24+ (base/init {:libpaths [" test/clojure_python/" ]})
25+ (class base/*interp*))
26+ =>
27+ (do
28+ (base/init {:libpaths [" test/clojure_python/" ]})
29+ (class base/*interp*)))
30+
31+ (fact " with-interpreter dynamically binds a new interpreter environment"
32+ (base/with-interpreter
33+ {:libpaths [" test/clojure_python/" ]}
34+ base/*interp*)
35+ =not=>
36+ (base/with-interpreter
37+ {:libpaths [" test/clojure_python/" ]}
38+ base/*interp*))
You can’t perform that action at this time.
0 commit comments