Skip to content

Commit fdfab8c

Browse files
committed
consolidate 'ls' tests
Change-Id: I11402fbb2672ae276652fdc415d5b8ee7cdafa84
1 parent 0845b82 commit fdfab8c

File tree

2 files changed

+23
-42
lines changed

2 files changed

+23
-42
lines changed

tests/test_ls.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,36 @@ test_lssitepackages_add2virtualenv () {
4444
deactivate
4545
}
4646

47-
test_no_workon_home () {
47+
test_lssitepackages_no_workon_home () {
4848
old_home="$WORKON_HOME"
4949
export WORKON_HOME="$WORKON_HOME/not_there"
50+
rm -rf "$WORKON_HOME"
5051
lssitepackages >"$old_home/output" 2>&1
5152
output=$(cat "$old_home/output")
5253
assertTrue "Did not see expected message" "echo $output | grep 'does not exist'"
5354
WORKON_HOME="$old_home"
5455
}
5556

57+
test_lsvirtualenv_no_workon_home () {
58+
old_home="$WORKON_HOME"
59+
export WORKON_HOME="$WORKON_HOME/not_there"
60+
rm -rf "$WORKON_HOME"
61+
lsvirtualenv >"$old_home/output" 2>&1
62+
output=$(cat "$old_home/output")
63+
assertTrue "Did not see expected message" "echo $output | grep -q 'does not exist'"
64+
WORKON_HOME="$old_home"
65+
}
66+
67+
test_lsvirtualenv_space_in_workon_home () {
68+
old_home="$WORKON_HOME"
69+
export WORKON_HOME="$WORKON_HOME/with space"
70+
mkdir "$WORKON_HOME"
71+
(cd "$WORKON_HOME"; virtualenv testenv) 2>&1
72+
lsvirtualenv -b >"$old_home/output"
73+
output=$(cat "$old_home/output")
74+
assertTrue "Did not see expected message in \"$output\"" "echo $output | grep -q 'testenv'"
75+
WORKON_HOME="$old_home"
76+
}
77+
5678

5779
. "$test_dir/shunit2"

tests/test_lsvirtualenv.sh

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)