(python-shell-interpreter-args "-B"))
(should (string=
(format "%s %s"
- python-shell-interpreter
+ (shell-quote-argument python-shell-interpreter)
python-shell-interpreter-args)
(python-shell-calculate-command)))))
(let ((process-environment '("PYTHONPATH=/path0"))
(python-shell-extra-pythonpaths '("/path1" "/path2")))
(should (string= (python-shell-calculate-pythonpath)
- "/path1:/path2:/path0"))))
+ (concat "/path1" path-separator
+ "/path2" path-separator "/path0")))))
(ert-deftest python-shell-calculate-pythonpath-2 ()
"Test existing paths are moved to front."
- (let ((process-environment '("PYTHONPATH=/path0:/path1"))
+ (let ((process-environment
+ (list (concat "PYTHONPATH=/path0" path-separator "/path1")))
(python-shell-extra-pythonpaths '("/path1" "/path2")))
(should (string= (python-shell-calculate-pythonpath)
- "/path1:/path2:/path0"))))
+ (concat "/path1" path-separator
+ "/path2" path-separator "/path0")))))
(ert-deftest python-shell-calculate-process-environment-1 ()
"Test `python-shell-process-environment' modification."
(original-pythonpath (setenv "PYTHONPATH" "/path0"))
(python-shell-extra-pythonpaths '("/path1" "/path2"))
(process-environment (python-shell-calculate-process-environment)))
- (should (equal (getenv "PYTHONPATH") "/path1:/path2:/path0"))))
+ (should (equal (getenv "PYTHONPATH")
+ (concat "/path1" path-separator
+ "/path2" path-separator "/path0")))))
(ert-deftest python-shell-calculate-process-environment-3 ()
"Test `python-shell-virtualenv-root' modification."
(let* ((exec-path '("/path0"))
(python-shell-virtualenv-root "/env")
(new-exec-path (python-shell-calculate-exec-path)))
- (should (equal new-exec-path '("/env/bin" "/path0")))))
+ (should (equal new-exec-path
+ (list (expand-file-name "/env/bin") "/path0")))))
(ert-deftest python-shell-calculate-exec-path-3 ()
"Test complete `python-shell-virtualenv-root' modification."
(python-shell-exec-path '("/path1" "/path2"))
(python-shell-virtualenv-root "/env")
(new-exec-path (python-shell-calculate-exec-path)))
- (should (equal new-exec-path '("/env/bin" "/path1" "/path2" "/path0")))))
+ (should (equal new-exec-path
+ (list (expand-file-name "/env/bin")
+ "/path1" "/path2" "/path0")))))
(ert-deftest python-shell-calculate-exec-path-4 ()
"Test complete `python-shell-virtualenv-root' with remote."
(python-shell-exec-path '("/path1" "/path2"))
(python-shell-virtualenv-root "/env")
(new-exec-path (python-shell-calculate-exec-path)))
- (should (equal new-exec-path '("/env/bin" "/path1" "/path2" "/path0")))))
+ (should (equal new-exec-path
+ (list (expand-file-name "/env/bin")
+ "/path1" "/path2" "/path0")))))
(ert-deftest python-shell-calculate-exec-path-5 ()
"Test no side-effects on `exec-path'."
(original-exec-path exec-path)
(python-shell-virtualenv-root "/env"))
(python-shell-with-environment
- (should (equal exec-path '("/env/bin" "/path1" "/path2" "/path0")))
+ (should (equal exec-path
+ (list (expand-file-name "/env/bin")
+ "/path1" "/path2" "/path0")))
(should (not (getenv "PYTHONHOME")))
(should (string= (getenv "VIRTUAL_ENV") "/env")))
(should (equal exec-path original-exec-path))))
(python-shell-virtualenv-root "/env"))
(python-shell-with-environment
(should (equal (python-shell-calculate-exec-path)
- '("/env/bin" "/path1" "/path2" "/remote1" "/remote2")))
+ (list (expand-file-name "/env/bin")
+ "/path1" "/path2" "/remote1" "/remote2")))
(let ((process-environment (python-shell-calculate-process-environment)))
(should (not (getenv "PYTHONHOME")))
(should (string= (getenv "VIRTUAL_ENV") "/env"))