@@ -7,46 +7,42 @@ source "$test_dir/../virtualenvwrapper_bashrc"
77
88export WORKON_HOME=" ${TMPDIR:-/ tmp} /WORKON_HOME"
99
10- oneTimeSetUp () {
10+ setUp () {
1111 rm -rf " $WORKON_HOME "
1212 mkdir -p " $WORKON_HOME "
13+ echo
14+ rm -f " $test_dir /catch_output"
1315}
1416
15- oneTimeTearDown () {
17+ tearDown () {
1618 rm -rf " $WORKON_HOME "
1719}
1820
19- setUp () {
20- echo
21- rm -f " $test_dir /catch_output"
22- }
23-
2421
2522test_cpvirtualenv () {
26- mkvirtualenv " cpvirtualenvtest "
27- $VIRTUAL_ENV /bin/easy_install " tests/testpackage"
28- cpvirtualenv " cpvirtualenvtest " " cpvirtualenvcopy "
23+ mkvirtualenv " source "
24+ (cd tests/testpackage && python setup.py install)
25+ cpvirtualenv " source " " destination "
2926 deactivate
30- rmvirtualenv " cpvirtualenvtest "
31- workon " cpvirtualenvcopy "
27+ rmvirtualenv " source "
28+ workon " destination "
3229 testscript=" $( which testscript.py) "
33- assertSame " $testscript " $( echo " $WORKON_HOME /cpvirtualenvcopy /bin/testscript.py" )
30+ assertTrue " Environment test script not found in path " " [ $WORKON_HOME /destination /bin/testscript.py -ef $testscript ] "
3431 testscriptcontent=" $( cat $testscript ) "
3532 assertTrue " No cpvirtualenvtest in $/testscriptcontent" " echo $testscriptcontent | grep cpvirtualenvtest"
3633 assertTrue virtualenvwrapper_verify_active_environment
37- assertSame " cpvirtualenvcopy" $( basename " $VIRTUAL_ENV " )
38- cdvirtualenv
39- assertSame " $VIRTUAL_ENV " " $( pwd) "
34+ assertSame " Wrong virtualenv name" " destination" $( basename " $VIRTUAL_ENV " )
4035}
4136
4237test_cprelocatablevirtualenv () {
43- mkvirtualenv " cprelocatabletest"
44- virtualenv --relocatable " $WORKON_HOME /cprelocatabletest"
45- cpvirtualenv " cprelocatabletest" " cprelocatablecopy"
38+ mkvirtualenv " source"
39+ (cd tests/testpackage && python setup.py install)
40+ assertTrue " virtualenv --relocatable \" $WORKON_HOME /source\" "
41+ cpvirtualenv " source" " destination"
42+ testscript=" $( which testscript.py) "
43+ assertTrue " Environment test script not the same as copy" " [ $WORKON_HOME /destination/bin/testscript.py -ef $testscript ]"
4644 assertTrue virtualenvwrapper_verify_active_environment
47- assertSame " cprelocatablecopy" $( basename " $VIRTUAL_ENV " )
48- cdvirtualenv
49- assertSame " $VIRTUAL_ENV " " $( pwd) "
45+ assertSame " Wrong virtualenv name" " destination" $( basename " $VIRTUAL_ENV " )
5046}
5147
5248test_cp_notexists () {
0 commit comments