@@ -21,6 +21,10 @@ setUp () {
2121 rm -f " $test_dir /catch_output"
2222}
2323
24+ tearDown () {
25+ echo
26+ }
27+
2428test_mkvirtualenv () {
2529 mkvirtualenv " env1"
2630 assertTrue " Environment directory was not created" " [ -d $WORKON_HOME /env1 ]"
@@ -267,7 +271,7 @@ test_add2virtualenv_relative () {
267271test_lssitepackages () {
268272 mkvirtualenv " lssitepackagestest"
269273 contents=" $( lssitepackages) "
270- assertTrue " No easy-install.pth in $contents " " echo $contents | grep easy-install.pth"
274+ assertTrue " No easy-install.pth in $/ contents" " echo $contents | grep easy-install.pth"
271275}
272276
273277test_lssitepackages_add2virtualenv () {
@@ -279,5 +283,31 @@ test_lssitepackages_add2virtualenv () {
279283 assertTrue " No $base_dir in $contents " " echo $contents | grep $base_dir "
280284}
281285
286+ test_cpvirtualenv () {
287+ mkvirtualenv " cpvirtualenvtest"
288+ $VIRTUAL_ENV /bin/easy_install " tests/testpackage"
289+ cpvirtualenv " cpvirtualenvtest" " cpvirtualenvcopy"
290+ deactivate
291+ rmvirtualenv " cpvirtualenvtest"
292+ workon " cpvirtualenvcopy"
293+ testscript=" $( which testscript.py) "
294+ assertSame " $testscript " $( echo " $WORKON_HOME /cpvirtualenvcopy/bin/testscript.py" )
295+ testscriptcontent=" $( cat $testscript ) "
296+ assertTrue " No cpvirtualenvtest in $/testscriptcontent" " echo $testscriptcontent | grep cpvirtualenvtest"
297+ assertTrue virtualenvwrapper_verify_active_environment
298+ assertSame " cpvirtualenvcopy" $( basename " $VIRTUAL_ENV " )
299+ cdvirtualenv
300+ assertSame " $VIRTUAL_ENV " " $( pwd) "
301+ }
302+
303+ test_cprelocatablevirtualenv () {
304+ mkvirtualenv " cprelocatabletest"
305+ virtualenv --relocatable " $WORKON_HOME /cprelocatabletest"
306+ cpvirtualenv " cprelocatabletest" " cprelocatablecopy"
307+ assertTrue virtualenvwrapper_verify_active_environment
308+ assertSame " cprelocatablecopy" $( basename " $VIRTUAL_ENV " )
309+ cdvirtualenv
310+ assertSame " $VIRTUAL_ENV " " $( pwd) "
311+ }
282312
283313. " $test_dir /shunit2"
0 commit comments