Skip to content

Commit f160690

Browse files
committed
add test for space in WORKON_HOME to address #79
1 parent eeb7efe commit f160690

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/test.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ test_virtualenvwrapper_initialize() {
3737
assertSame "$expected" "$output"
3838
}
3939

40+
test_virtualenvwrapper_space_in_workon_home() {
41+
before="$WORKON_HOME"
42+
export WORKON_HOME="$WORKON_HOME/this has spaces"
43+
expected="$WORKON_HOME"
44+
mkdir -p "$expected"
45+
virtualenvwrapper_initialize
46+
RC=$?
47+
assertSame "$expected" "$WORKON_HOME"
48+
assertSame "0" "$RC"
49+
export WORKON_HOME="$before"
50+
}
51+
4052
test_virtualenvwrapper_verify_workon_home() {
4153
assertTrue "WORKON_HOME not verified" virtualenvwrapper_verify_workon_home
4254
}
@@ -79,7 +91,7 @@ test_python_interpreter_set_incorrectly() {
7991
mkvirtualenv --no-site-packages no_wrappers
8092
expected="ImportError: No module named virtualenvwrapper.hook_loader"
8193
output=$(VIRTUALENVWRAPPER_PYTHON=$(which python) $SHELL $return_to/virtualenvwrapper.sh 2>&1)
82-
echo "$output" | grep "$expected" 2>&1
94+
echo "$output" | grep -q "$expected" 2>&1
8395
found=$?
8496
assertTrue "Expected \"$expected\", got: \"$output\"" "[ $found -eq 0 ]"
8597
assertFalse "Failed to detect invalid Python location" "VIRTUALENVWRAPPER_PYTHON=$VIRTUAL_ENV/bin/python $SHELL $return_to/virtualenvwrapper.sh >/dev/null 2>&1"

0 commit comments

Comments
 (0)