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() {
56
56
test_virtualenvwrapper_verify_workon_home_missing_dir () {
57
57
old_home=" $WORKON_HOME "
58
58
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
60
62
WORKON_HOME=" $old_home "
61
63
}
62
64
@@ -66,19 +68,11 @@ test_virtualenvwrapper_verify_workon_home_missing_dir_grep_options() {
66
68
# This should prevent the message from being found if it isn't
67
69
# unset correctly.
68
70
export GREP_OPTIONS=" --count"
69
- assertFalse " WORKON_HOME verified unexpectedly " virtualenvwrapper_verify_workon_home
71
+ assertTrue " WORKON_HOME not verified " virtualenvwrapper_verify_workon_home
70
72
WORKON_HOME=" $old_home "
71
73
unset GREP_OPTIONS
72
74
}
73
75
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
-
82
76
test_get_python_version () {
83
77
expected=$( python -V 2>&1 | cut -f2 -d' ' | cut -f-2 -d.)
84
78
actual=$( virtualenvwrapper_get_python_version)
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ setUp () {
26
26
}
27
27
28
28
tearDown () {
29
- deactivate
29
+ deactivate > /dev/null 2>&1
30
30
}
31
31
32
32
test_cdvirtual () {
@@ -60,16 +60,18 @@ test_cdsitepackages_with_arg () {
60
60
test_cdvirtualenv_no_workon_home () {
61
61
old_home=" $WORKON_HOME "
62
62
export WORKON_HOME=" $WORKON_HOME /not_there"
63
- output=` cdvirtualenv 2>&1 `
63
+ output=$( cdvirtualenv 2>&1 )
64
64
assertTrue " Did not see expected message" " echo $output | grep 'does not exist'"
65
65
WORKON_HOME=" $old_home "
66
66
}
67
67
68
68
test_cdsitepackages_no_workon_home () {
69
+ deactivate 2>&1
69
70
old_home=" $WORKON_HOME "
71
+ cd " $WORKON_HOME "
70
72
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 ) "
73
75
WORKON_HOME=" $old_home "
74
76
}
75
77
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ test_dir=$(cd $(dirname $0) && pwd)
6
6
7
7
export WORKON_HOME=" $( echo ${TMPDIR:-/ tmp} /WORKON_HOME | sed ' s|//|/|g' ) "
8
8
9
- unset HOOK_VERBOSE_OPTION
9
+ # unset HOOK_VERBOSE_OPTION
10
10
11
11
setUp () {
12
12
rm -rf " $WORKON_HOME "
Original file line number Diff line number Diff line change @@ -97,13 +97,13 @@ virtualenvwrapper_derive_workon_home() {
97
97
virtualenvwrapper_verify_workon_home () {
98
98
if [ ! -d " $WORKON_HOME " ]
99
99
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
101
101
mkdir $WORKON_HOME
102
102
fi
103
103
return 0
104
104
}
105
105
106
- # HOOK_VERBOSE_OPTION="-v "
106
+ # HOOK_VERBOSE_OPTION="-q "
107
107
108
108
# Expects 1 argument, the suffix for the new file.
109
109
virtualenvwrapper_tempfile () {
You can’t perform that action at this time.
0 commit comments