forked from rplevy/clojure-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore_test.clj
More file actions
27 lines (22 loc) · 800 Bytes
/
core_test.clj
File metadata and controls
27 lines (22 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(ns clojure-python.core-test
(:use [clojure-python.core] :reload-all)
(:use [clojure.test]))
(comment
(deftest test-python
(let [py (python 'py-interp
:pre-properties {:foo "bar"}
:post-properties {:bar "foo"}
:argv ["one" "two" "three"]
:sys-path []
:modules [['mod1 {:funcs ['f1 'f2] :objs ['o1 'o2]}]]
)]))
)
(deftest test-python-init
(let [py (python 'py-interp
:post-properties {"python.home" "/usr/local/my-python"}
:argv ["one" "two" "three"])]
(.exec py "import sys")
(is (= ["one", "two", "three"] (map str (.eval py "sys.argv"))))
(is (some
#(= % "/usr/local/my-python/Lib")
(map str (.eval py "sys.path"))))))