-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathtest_lazy_loaded.sh
More file actions
executable file
·111 lines (86 loc) · 2.61 KB
/
test_lazy_loaded.sh
File metadata and controls
executable file
·111 lines (86 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# -*- mode: shell-script -*-
test_dir=$(cd $(dirname $0) && pwd)
source "$test_dir/setup.sh"
oneTimeSetUp() {
rm -rf "$WORKON_HOME"
mkdir -p "$WORKON_HOME"
source "$test_dir/../virtualenvwrapper_lazy.sh"
virtualenvwrapper_load
}
oneTimeTearDown() {
rm -rf "$WORKON_HOME"
}
setUp () {
echo
}
function_defined_normal() {
name="$1"
assertTrue "$name not defined" "type $name"
assertFalse "$name still set to run lazy loader" "typeset -f $name | grep 'virtualenvwrapper_load'"
}
test_mkvirtualenv_defined_normal() {
function_defined_normal mkvirtualenv
}
test_rmvirtualenv_defined_normal() {
function_defined_normal rmvirtualenv
}
test_lsvirtualenv_defined_normal() {
function_defined_normal lsvirtualenv
}
test_showvirtualenv_defined_normal() {
function_defined_normal showvirtualenv
}
test_workon_defined_normal() {
function_defined_normal workon
}
test_add2virtualenv_defined_normal() {
function_defined_normal add2virtualenv
}
test_cdsitepackages_defined_normal() {
function_defined_normal cdsitepackages
}
test_cdvirtualenv_defined_normal() {
function_defined_normal cdvirtualenv
}
test_cdvirtualenv_defined_normal() {
function_defined_normal cdvirtualenv
}
test_lssitepackages_defined_normal() {
function_defined_normal lssitepackages
}
test_cpvirtualenv_defined_normal() {
function_defined_normal cpvirtualenv
}
test_setvirtualenvproject_defined_normal() {
function_defined_normal setvirtualenvproject
}
test_mkproject_defined_normal() {
function_defined_normal mkproject
}
test_cdproject_defined_normal() {
function_defined_normal cdproject
}
test_mktmpenv_defined_normal() {
function_defined_normal mktmpenv
}
test_wipeenv_defined_normal() {
function_defined_normal wipeenv
}
test_allvirtualenv_defined_normal() {
function_defined_normal allvirtualenv
}
# test_virtualenvwrapper_initialize() {
# assertTrue "Initialized" virtualenvwrapper_initialize
# for hook in premkvirtualenv postmkvirtualenv prermvirtualenv postrmvirtualenv preactivate postactivate predeactivate postdeactivate
# do
# assertTrue "Global $WORKON_HOME/$hook was not created" "[ -f $WORKON_HOME/$hook ]"
# assertTrue "Global $WORKON_HOME/$hook is not executable" "[ -x $WORKON_HOME/$hook ]"
# done
# assertTrue "Log file was not created" "[ -f $WORKON_HOME/hook.log ]"
# echo "echo GLOBAL initialize >> \"$TMPDIR/catch_output\"" >> "$WORKON_HOME/initialize"
# virtualenvwrapper_initialize
# output=$(cat "$TMPDIR/catch_output")
# expected="GLOBAL initialize"
# assertSame "$expected" "$output"
# }
. "$test_dir/shunit2"