@@ -22,45 +22,45 @@ setUp () {
22
22
}
23
23
24
24
test_add2virtualenv () {
25
- mkvirtualenv " pathtest"
25
+ mkvirtualenv " pathtest" > /dev/null 2>&1
26
26
full_path=$( pwd)
27
27
add2virtualenv " $full_path "
28
28
cdsitepackages
29
29
# Check contents of path file
30
30
path_file=" ./_virtualenv_path_extensions.pth"
31
- assertTrue " No $full_path in $( cat $path_file ) " " grep $full_path $path_file "
32
- assertTrue " No path insert code in $( cat $path_file ) " " grep sys.__egginsert $path_file "
31
+ assertTrue " No $full_path in $( cat $path_file ) " " grep -q $full_path $path_file "
32
+ assertTrue " No path insert code in $( cat $path_file ) " " grep -q sys.__egginsert $path_file "
33
33
# Check the path we inserted is actually at the top
34
- expected=$full_path
34
+ expected=" $full_path "
35
35
actual=$( $WORKON_HOME /pathtest/bin/python -c " import sys; print sys.path[1]" )
36
36
assertSame " $expected " " $actual "
37
-
38
37
# Make sure the temporary file created
39
38
# during the edit was removed
40
39
assertFalse " Temporary file ${path_file} .tmp still exists" " [ -f ${path_file} .tmp ]"
41
-
42
- cd -
40
+ cd - > /dev/null 2>&1
43
41
}
44
42
45
43
test_add2virtualenv_relative () {
46
- mkvirtualenv " pathtest"
44
+ mkvirtualenv " pathtest" > /dev/null 2>&1
47
45
parent_dir=$( dirname $( pwd) )
48
46
base_dir=$( basename $( pwd) )
49
47
add2virtualenv " ../$base_dir "
50
48
cdsitepackages
51
49
path_file=" ./_virtualenv_path_extensions.pth"
52
- assertTrue " No $parent_dir /$base_dir in \" ` cat $path_file ` \" " " grep \" $parent_dir /$base_dir \" $path_file "
50
+ assertTrue " No $parent_dir /$base_dir in \" ` cat $path_file ` \" " " grep -q \" $parent_dir /$base_dir \" $path_file "
53
51
cd - > /dev/null 2>&1
54
52
}
55
53
56
54
test_add2virtualenv_delete () {
57
- mkvirtualenv " pathtest"
55
+ path_file=" ./_virtualenv_path_extensions.pth"
56
+ mkvirtualenv " pathtest" > /dev/null 2>&1
57
+ cdsitepackages
58
+ # Make sure it was added
58
59
add2virtualenv " /full/path"
60
+ assertTrue " No $full_path in $( cat $path_file ) " " grep -q $full_path $path_file "
61
+ # Remove it and verify that change
59
62
add2virtualenv -d " /full/path"
60
- cdsitepackages
61
- # Check contents of path file
62
- path_file=" ./_virtualenv_path_extensions.pth"
63
- assertFalse " /full/path in ` cat $path_file ` " " grep /full/path $path_file "
63
+ assertFalse " /full/path in ` cat $path_file ` " " grep -q /full/path $path_file "
64
64
cd -
65
65
}
66
66
0 commit comments