Skip to content

Commit e416243

Browse files
committed
quiet tests and add intermediate check for delete
1 parent 1bfc94a commit e416243

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/test_add2virtualenv.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,45 @@ setUp () {
2222
}
2323

2424
test_add2virtualenv () {
25-
mkvirtualenv "pathtest"
25+
mkvirtualenv "pathtest" >/dev/null 2>&1
2626
full_path=$(pwd)
2727
add2virtualenv "$full_path"
2828
cdsitepackages
2929
# Check contents of path file
3030
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"
3333
# Check the path we inserted is actually at the top
34-
expected=$full_path
34+
expected="$full_path"
3535
actual=$($WORKON_HOME/pathtest/bin/python -c "import sys; print sys.path[1]")
3636
assertSame "$expected" "$actual"
37-
3837
# Make sure the temporary file created
3938
# during the edit was removed
4039
assertFalse "Temporary file ${path_file}.tmp still exists" "[ -f ${path_file}.tmp ]"
41-
42-
cd -
40+
cd - >/dev/null 2>&1
4341
}
4442

4543
test_add2virtualenv_relative () {
46-
mkvirtualenv "pathtest"
44+
mkvirtualenv "pathtest" >/dev/null 2>&1
4745
parent_dir=$(dirname $(pwd))
4846
base_dir=$(basename $(pwd))
4947
add2virtualenv "../$base_dir"
5048
cdsitepackages
5149
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"
5351
cd - >/dev/null 2>&1
5452
}
5553

5654
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
5859
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
5962
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"
6464
cd -
6565
}
6666

0 commit comments

Comments
 (0)