-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathtest_project.sh
More file actions
executable file
·55 lines (46 loc) · 1.43 KB
/
test_project.sh
File metadata and controls
executable file
·55 lines (46 loc) · 1.43 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
# -*- mode: shell-script -*-
test_dir=$(dirname $0)
source "$test_dir/setup.sh"
oneTimeSetUp() {
rm -rf "$WORKON_HOME"
mkdir -p "$WORKON_HOME"
rm -rf "$PROJECT_HOME"
mkdir -p "$PROJECT_HOME"
}
oneTimeTearDown() {
rm -rf "$WORKON_HOME"
rm -rf "$PROJECT_HOME"
}
setUp () {
echo
unset VIRTUALENVWRAPPER_INITIALIZED
}
test_initialize() {
load_wrappers
for hook in premkproject postmkproject
do
assertTrue "Global $hook was not created" "[ -f $WORKON_HOME/$hook ]"
assertTrue "Global $hook is not executable" "[ -x $WORKON_HOME/$hook ]"
done
}
test_initialize_hook_dir() {
export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME/hooks"
mkdir -p "$VIRTUALENVWRAPPER_HOOK_DIR"
load_wrappers
for hook in premkproject postmkproject
do
assertTrue "Global $hook was not created" "[ -f $VIRTUALENVWRAPPER_HOOK_DIR/$hook ]"
assertTrue "Global $hook is not executable" "[ -x $VIRTUALENVWRAPPER_HOOK_DIR/$hook ]"
done
VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME"
}
test_virtualenvwrapper_verify_project_home() {
assertTrue "PROJECT_HOME not verified" virtualenvwrapper_verify_project_home
}
test_virtualenvwrapper_verify_project_home_missing_dir() {
old_home="$PROJECT_HOME"
PROJECT_HOME="$PROJECT_HOME/not_there"
assertFalse "PROJECT_HOME verified unexpectedly" virtualenvwrapper_verify_project_home
PROJECT_HOME="$old_home"
}
. "$test_dir/shunit2"