@@ -7,46 +7,42 @@ source "$test_dir/../virtualenvwrapper_bashrc"
7
7
8
8
export WORKON_HOME=" ${TMPDIR:-/ tmp} /WORKON_HOME"
9
9
10
- oneTimeSetUp () {
10
+ setUp () {
11
11
rm -rf " $WORKON_HOME "
12
12
mkdir -p " $WORKON_HOME "
13
+ echo
14
+ rm -f " $test_dir /catch_output"
13
15
}
14
16
15
- oneTimeTearDown () {
17
+ tearDown () {
16
18
rm -rf " $WORKON_HOME "
17
19
}
18
20
19
- setUp () {
20
- echo
21
- rm -f " $test_dir /catch_output"
22
- }
23
-
24
21
25
22
test_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 "
29
26
deactivate
30
- rmvirtualenv " cpvirtualenvtest "
31
- workon " cpvirtualenvcopy "
27
+ rmvirtualenv " source "
28
+ workon " destination "
32
29
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 ] "
34
31
testscriptcontent=" $( cat $testscript ) "
35
32
assertTrue " No cpvirtualenvtest in $/testscriptcontent" " echo $testscriptcontent | grep cpvirtualenvtest"
36
33
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 " )
40
35
}
41
36
42
37
test_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 ]"
46
44
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 " )
50
46
}
51
47
52
48
test_cp_notexists () {
0 commit comments