22
33# set -x
44
5- test_dir=$( dirname $0 )
5+ test_dir=$( cd $( dirname $0 ) && pwd )
66
7- export WORKON_HOME=" ${TMPDIR:-/ tmp} /WORKON_HOME"
7+ export WORKON_HOME=" $( echo $ {TMPDIR:-/ tmp} /WORKON_HOME | sed ' s|//|/|g ' ) "
88
99unset HOOK_VERBOSE_OPTION
1010
@@ -24,21 +24,26 @@ tearDown() {
2424 rm -rf " $WORKON_HOME "
2525}
2626
27- test_cpvirtualenv () {
27+ test_new_env_activated () {
2828 mkvirtualenv " source"
2929 (cd tests/testpackage && python setup.py install) > /dev/null 2>&1
3030 cpvirtualenv " source" " destination"
31- assertSame " destination" $( basename " $VIRTUAL_ENV " )
3231 rmvirtualenv " source"
3332 testscript=" $( which testscript.py) "
3433 assertTrue " Environment test script not found in path" " [ $WORKON_HOME /destination/bin/testscript.py -ef $testscript ]"
3534 testscriptcontent=" $( cat $testscript ) "
36- assertTrue " No cpvirtualenvtest in $/ testscriptcontent" " echo $testscriptcontent | grep cpvirtualenvtest"
35+ assertTrue " No cpvirtualenvtest in $testscriptcontent " " echo $testscriptcontent | grep cpvirtualenvtest"
3736 assertTrue virtualenvwrapper_verify_active_environment
37+ }
38+
39+ test_virtual_env_variable () {
40+ mkvirtualenv " source"
41+ cpvirtualenv " source" " destination"
3842 assertSame " Wrong virtualenv name" " destination" $( basename " $VIRTUAL_ENV " )
43+ assertTrue " $WORKON_HOME not in $VIRTUAL_ENV " " echo $VIRTUAL_ENV | grep -q $WORKON_HOME "
3944}
4045
41- test_cprelocatablevirtualenv () {
46+ test_source_relocatable () {
4247 mkvirtualenv " source"
4348 (cd tests/testpackage && python setup.py install) > /dev/null 2>&1
4449 assertTrue " virtualenv --relocatable \" $WORKON_HOME /source\" "
@@ -49,7 +54,7 @@ test_cprelocatablevirtualenv () {
4954 assertSame " Wrong virtualenv name" " destination" $( basename " $VIRTUAL_ENV " )
5055}
5156
52- test_cp_notexists () {
57+ test_source_does_not_exist () {
5358 out=" $( cpvirtualenv virtualenvthatdoesntexist foo) "
5459 assertSame " $out " " virtualenvthatdoesntexist virtualenv doesn't exist"
5560}
0 commit comments