@@ -9,7 +9,7 @@ export WORKON_HOME="$(echo ${TMPDIR:-/tmp}/WORKON_HOME | sed 's|//|/|g')"
9
9
oneTimeSetUp () {
10
10
rm -rf " $WORKON_HOME "
11
11
mkdir -p " $WORKON_HOME "
12
- source " $test_dir /../virtualenvwrapper.sh"
12
+ source " $test_dir /../virtualenvwrapper.sh" > /dev/null 2>&1
13
13
}
14
14
15
15
oneTimeTearDown () {
@@ -41,7 +41,7 @@ test_add2virtualenv () {
41
41
}
42
42
43
43
test_add2virtualenv_relative () {
44
- mkvirtualenv " pathtest " > /dev/null 2>&1
44
+ mkvirtualenv " pathtest_relative " > /dev/null 2>&1
45
45
parent_dir=$( dirname $( pwd) )
46
46
base_dir=$( basename $( pwd) )
47
47
add2virtualenv " ../$base_dir "
@@ -51,18 +51,70 @@ test_add2virtualenv_relative () {
51
51
cd - > /dev/null 2>&1
52
52
}
53
53
54
+ test_add2virtualenv_space () {
55
+ # see #132
56
+ mkvirtualenv " pathtest_space" > /dev/null 2>&1
57
+ parent_dir=$( dirname $( pwd) )
58
+ cdvirtualenv
59
+ mkdir ' a b'
60
+ add2virtualenv ' a b'
61
+ cdsitepackages
62
+ path_file=" ./_virtualenv_path_extensions.pth"
63
+ assertTrue " No 'a b' in \" ` cat $path_file ` \" " " grep -q 'a b' $path_file "
64
+ cd - > /dev/null 2>&1
65
+ }
66
+
67
+ test_add2virtualenv_ampersand () {
68
+ # see #132
69
+ mkvirtualenv " pathtest_ampersand" > /dev/null 2>&1
70
+ parent_dir=$( dirname $( pwd) )
71
+ cdvirtualenv
72
+ mkdir ' a & b'
73
+ add2virtualenv ' a & b'
74
+ cdsitepackages
75
+ path_file=" ./_virtualenv_path_extensions.pth"
76
+ assertTrue " No 'a & b' in \" ` cat $path_file ` \" " " grep -q 'a & b' $path_file "
77
+ cd - > /dev/null 2>&1
78
+ }
79
+
54
80
test_add2virtualenv_delete () {
55
81
path_file=" ./_virtualenv_path_extensions.pth"
56
- mkvirtualenv " pathtest " > /dev/null 2>&1
82
+ mkvirtualenv " pathtest_delete " > /dev/null 2>&1
57
83
cdsitepackages
58
84
# Make sure it was added
59
85
add2virtualenv " /full/path"
60
- assertTrue " No $full_path in $( cat $path_file ) " " grep -q $full_path $path_file "
86
+ assertTrue " No /full/path in $( cat $path_file ) " " grep -q /full/path $path_file "
61
87
# Remove it and verify that change
62
88
add2virtualenv -d " /full/path"
63
89
assertFalse " /full/path in ` cat $path_file ` " " grep -q /full/path $path_file "
64
90
cd - > /dev/null 2>&1
65
91
}
66
92
93
+ test_add2virtualenv_delete_space () {
94
+ path_file=" ./_virtualenv_path_extensions.pth"
95
+ mkvirtualenv " pathtest_delete_space" > /dev/null 2>&1
96
+ cdsitepackages
97
+ # Make sure it was added
98
+ add2virtualenv " /full/path with spaces"
99
+ assertTrue " No /full/path with spaces in $( cat $path_file ) " " grep -q '/full/path with spaces' $path_file "
100
+ # Remove it and verify that change
101
+ add2virtualenv -d " /full/path with spaces"
102
+ assertFalse " /full/path with spaces in ` cat $path_file ` " " grep -q '/full/path with spaces' $path_file "
103
+ cd - > /dev/null 2>&1
104
+ }
105
+
106
+ test_add2virtualenv_delete_ampersand () {
107
+ path_file=" ./_virtualenv_path_extensions.pth"
108
+ mkvirtualenv " pathtest_delete_ampersand" > /dev/null 2>&1
109
+ cdsitepackages
110
+ # Make sure it was added
111
+ add2virtualenv " /full/path & dir"
112
+ assertTrue " No /full/path & dir in $( cat $path_file ) " " grep -q '/full/path & dir' $path_file "
113
+ # Remove it and verify that change
114
+ add2virtualenv -d " /full/path & dir"
115
+ assertFalse " /full/path & dir in ` cat $path_file ` " " grep -q '/full/path & dir' $path_file "
116
+ cd - > /dev/null 2>&1
117
+ }
118
+
67
119
68
120
. " $test_dir /shunit2"
0 commit comments