File tree Expand file tree Collapse file tree 4 files changed +13
-17
lines changed
Expand file tree Collapse file tree 4 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ test_virtualenvwrapper_verify_workon_home() {
5656test_virtualenvwrapper_verify_workon_home_missing_dir () {
5757 old_home=" $WORKON_HOME "
5858 WORKON_HOME=" $WORKON_HOME /not_there"
59- assertFalse " WORKON_HOME verified unexpectedly" virtualenvwrapper_verify_workon_home
59+ output=$( virtualenvwrapper_verify_workon_home 2>&1 )
60+ assertSame " NOTE: Virtual environments directory $WORKON_HOME does not exist. Creating..." " $output "
61+ assertTrue " WORKON_HOME verified unexpectedly" virtualenvwrapper_verify_workon_home
6062 WORKON_HOME=" $old_home "
6163}
6264
@@ -66,19 +68,11 @@ test_virtualenvwrapper_verify_workon_home_missing_dir_grep_options() {
6668 # This should prevent the message from being found if it isn't
6769 # unset correctly.
6870 export GREP_OPTIONS=" --count"
69- assertFalse " WORKON_HOME verified unexpectedly " virtualenvwrapper_verify_workon_home
71+ assertTrue " WORKON_HOME not verified " virtualenvwrapper_verify_workon_home
7072 WORKON_HOME=" $old_home "
7173 unset GREP_OPTIONS
7274}
7375
74- test_virtualenvwrapper_verify_workon_home_missing_dir_quiet_init () {
75- old_home=" $WORKON_HOME "
76- export WORKON_HOME=" $WORKON_HOME /not_there"
77- output=$( source $test_dir /../virtualenvwrapper.sh 2>&1 )
78- assertSame " " " $output "
79- WORKON_HOME=" $old_home "
80- }
81-
8276test_get_python_version () {
8377 expected=$( python -V 2>&1 | cut -f2 -d' ' | cut -f-2 -d.)
8478 actual=$( virtualenvwrapper_get_python_version)
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ setUp () {
2626}
2727
2828tearDown () {
29- deactivate
29+ deactivate > /dev/null 2>&1
3030}
3131
3232test_cdvirtual () {
@@ -60,16 +60,18 @@ test_cdsitepackages_with_arg () {
6060test_cdvirtualenv_no_workon_home () {
6161 old_home=" $WORKON_HOME "
6262 export WORKON_HOME=" $WORKON_HOME /not_there"
63- output=` cdvirtualenv 2>&1 `
63+ output=$( cdvirtualenv 2>&1 )
6464 assertTrue " Did not see expected message" " echo $output | grep 'does not exist'"
6565 WORKON_HOME=" $old_home "
6666}
6767
6868test_cdsitepackages_no_workon_home () {
69+ deactivate 2>&1
6970 old_home=" $WORKON_HOME "
71+ cd " $WORKON_HOME "
7072 export WORKON_HOME=" $WORKON_HOME /not_there"
71- output= ` cdsitepackages 2>&1 `
72- assertTrue " Did not see expected message " " echo $output | grep 'does not exist' "
73+ assertFalse " Was able to change to site-packages " cdsitepackages
74+ assertSame " $old_home " " $( pwd ) "
7375 WORKON_HOME=" $old_home "
7476}
7577
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ test_dir=$(cd $(dirname $0) && pwd)
66
77export WORKON_HOME=" $( echo ${TMPDIR:-/ tmp} /WORKON_HOME | sed ' s|//|/|g' ) "
88
9- unset HOOK_VERBOSE_OPTION
9+ # unset HOOK_VERBOSE_OPTION
1010
1111setUp () {
1212 rm -rf " $WORKON_HOME "
Original file line number Diff line number Diff line change @@ -97,13 +97,13 @@ virtualenvwrapper_derive_workon_home() {
9797virtualenvwrapper_verify_workon_home () {
9898 if [ ! -d " $WORKON_HOME " ]
9999 then
100- [ " $1 " != " -q" ] && echo " NOTE: Virtual environments directory ' $WORKON_HOME ' does not exist. Creating..." 1>&2
100+ [ " $1 " != " -q" ] && echo " NOTE: Virtual environments directory $WORKON_HOME does not exist. Creating..." 1>&2
101101 mkdir $WORKON_HOME
102102 fi
103103 return 0
104104}
105105
106- # HOOK_VERBOSE_OPTION="-v "
106+ # HOOK_VERBOSE_OPTION="-q "
107107
108108# Expects 1 argument, the suffix for the new file.
109109virtualenvwrapper_tempfile () {
You can’t perform that action at this time.
0 commit comments