We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6302c43 commit 4fa1041Copy full SHA for 4fa1041
1 file changed
tests/test_project.sh
@@ -52,4 +52,24 @@ test_virtualenvwrapper_verify_project_home_missing_dir() {
52
PROJECT_HOME="$old_home"
53
}
54
55
+test_virtualenvwrapper_postactivate_hook() {
56
+ load_wrappers
57
+ mkproject "test_project_hook"
58
+ mkdir .virtualenvwrapper
59
+ echo "export TEST_PROJECT_HOOK_VAR=true" > .virtualenvwrapper/postactivate
60
+ echo "unset TEST_PROJECT_HOOK_VAR" > .virtualenvwrapper/predeactivate
61
+ deactivate
62
+
63
+ # Variable should not be set to start
64
+ assertSame "${TEST_PROJECT_HOOK_VAR}" ""
65
66
+ # Activating the env should set it
67
+ workon "test_project_hook"
68
+ assertSame "true" "${TEST_PROJECT_HOOK_VAR}"
69
70
+ # Deactivating should unset it
71
72
+ assertSame "" "${TEST_PROJECT_HOOK_VAR}"
73
+}
74
75
. "$test_dir/shunit2"
0 commit comments