Commits

barberj committed 91ccdcc

Fix test_derive_workon_home issue with zsh shell.
Add a test for expandpath

  • Participants
  • Parent commits ac7f9d2
  • Branches importvirtualenv

Comments (0)

Files changed (2)

File tests/test_expandpath.sh

+#!/bin/sh
+
+test_dir=$(cd $(dirname $0) && pwd)
+source "$test_dir/setup.sh"
+TMP_WORKON_HOME="$WORKON_HOME"
+
+oneTimeSetUp() {
+    source "$test_dir/../virtualenvwrapper.sh"
+    echo $PYTHONPATH
+}
+
+oneTimeTearDown() {
+    return 0
+}
+
+test_tilde() {
+    assertSame "$HOME" "$(expandpath ~)"
+}
+
+test_vars() {
+    assertSame "$HOME" "$(expandpath $HOME)"
+}
+
+test_tilde_vars() {
+    assertSame "$HOME" "$(expandpath ~$USER)"
+}
+
+. "$test_dir/shunit2"

File virtualenvwrapper.sh

 fi
 
 function expandpath {
-        if [ "$1" == "" ]; then
+        if [ "$1" = "" ]; then
             return 1
         else
             "$VIRTUALENVWRAPPER_PYTHON" -c "import os,sys; sys.stdout.write(os.path.realpath(os.path.expandvars(os.path.expanduser(\"$1\")))+'\n')"