File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -52,4 +52,24 @@ test_virtualenvwrapper_verify_project_home_missing_dir() {
52
52
PROJECT_HOME=" $old_home "
53
53
}
54
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
+ deactivate
72
+ assertSame " " " ${TEST_PROJECT_HOOK_VAR} "
73
+ }
74
+
55
75
. " $test_dir /shunit2"
You can’t perform that action at this time.
0 commit comments