Skip to content

Commit 9490141

Browse files
committed
fix tempdir tests to work on ubuntu 10.10
1 parent 8d8c0eb commit 9490141

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/test_tempfile.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
test_dir=$(cd $(dirname $0) && pwd)
66

7-
export WORKON_HOME="$(echo ${TMPDIR:-/tmp}/WORKON_HOME | sed 's|//|/|g')"
7+
tmplocation=${TMPDIR:-/tmp}
8+
export WORKON_HOME="$(echo ${tmplocation}/WORKON_HOME | sed 's|//|/|g')"
89

910
export HOOK_VERBOSE_OPTION=-v
1011

@@ -28,15 +29,15 @@ test_tempfile () {
2829
filename=$(virtualenvwrapper_tempfile hook)
2930
assertTrue "Filename is empty" "[ ! -z \"$filename\" ]"
3031
rm -f $filename
31-
comparable_tmpdir=$(echo $TMPDIR | sed 's|/$||')
32+
comparable_tmpdir=$(echo $tmplocation | sed 's|/$||')
3233
comparable_dirname=$(dirname $filename | sed 's|/$||')
33-
assertSame "TMPDIR and path not the same for $filename" "$comparable_tmpdir" "$comparable_dirname"
34+
assertSame "Temporary directory \"$tmplocation\" and path not the same for $filename" "$comparable_tmpdir" "$comparable_dirname"
3435
assertTrue "virtualenvwrapper-hook not in filename." "echo $filename | grep virtualenvwrapper-hook"
3536
}
3637

3738
test_no_such_tmpdir () {
3839
old_tmpdir="$TMPDIR"
39-
TMPDIR="$TMPDIR/does-not-exist"
40+
export TMPDIR="$tmplocation/does-not-exist"
4041
virtualenvwrapper_run_hook "initialize" >/dev/null 2>&1
4142
RC=$?
4243
assertSame "Unexpected exit code $RC" "1" "$RC"
@@ -45,7 +46,7 @@ test_no_such_tmpdir () {
4546

4647
test_tmpdir_not_writable () {
4748
old_tmpdir="$TMPDIR"
48-
TMPDIR="$TMPDIR/cannot-write"
49+
export TMPDIR="$tmplocation/cannot-write"
4950
mkdir "$TMPDIR"
5051
chmod ugo-w "$TMPDIR"
5152
virtualenvwrapper_run_hook "initialize" >/dev/null 2>&1

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ commands = bash ./tests/run_tests {envdir} []
77
# Not sure why this is needed, but on my system if it isn't included then
88
# the python version picked up for 2.6 is actually 2.7.
99
# IF THIS CAUSES YOU A PROBLEM COMMENT IT OUT BEFORE RUNNING THE TESTS.
10-
[testenv:py26]
11-
basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
10+
#[testenv:py26]
11+
#basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6

0 commit comments

Comments
 (0)