Skip to content

Commit 3f96884

Browse files
committed
test both mkvirtualenv hooks
1 parent f19032a commit 3f96884

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,17 @@ test_mkvirtualenv_activates () {
7070
assertSame "env2" $(basename "$VIRTUAL_ENV")
7171
}
7272

73-
test_postmkvirtualenv () {
74-
echo "echo GLOBAL postmkvirtualenv > $test_dir/catch_output" > "$WORKON_HOME/postmkvirtualenv"
73+
test_mkvirtualenv_hooks () {
74+
export pre_test_dir=$(cd "$test_dir"; pwd)
75+
echo "echo GLOBAL premkvirtualenv >> \"$pre_test_dir/catch_output\"" >> "$WORKON_HOME/premkvirtualenv"
76+
chmod +x "$WORKON_HOME/premkvirtualenv"
77+
echo "echo GLOBAL postmkvirtualenv >> $test_dir/catch_output" > "$WORKON_HOME/postmkvirtualenv"
7578
mkvirtualenv "env3"
7679
output=$(cat "$test_dir/catch_output")
77-
expected="GLOBAL postmkvirtualenv"
80+
expected="GLOBAL premkvirtualenv
81+
GLOBAL postmkvirtualenv"
7882
assertSame "$expected" "$output"
83+
rm -f "$WORKON_HOME/premkvirtualenv"
7984
rm -f "$WORKON_HOME/postmkvirtualenv"
8085
deactivate
8186
rmvirtualenv "env3"

0 commit comments

Comments
 (0)